Skip to content

Add the generated builders in the Test project? #8

Description

@JoanComasFdz

Right now the builders are created in the same project where the decorated classes live in.

Given that the Attributes and the SourceGenerator and already split in two NuGet packages, I would like to be able to decorate the classes in the production project, but create the Data Builders in the test project.

Example:

TestApp

  • Dependencies
    • Packages
      • DataBuilderGenerator.Attributes
  • Person.cs

TestApp.Tests

  • Dependencies
    • Analyzers
      • DataBuilderGenerator
    • Packages
      • DataBuilderGenerator

After building the solution:

TestApp.Tests

  • Dependencies
    • Analyzers
      • DataBuilderGenerator
        • PersonBuilder.cs
    • Packages
      • DataBuilderGenerator

This way, production code is not polluted with testing code.

Do you have any directions on how to achieve this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions