Replies: 1 comment 1 reply
-
|
I'm not aware of an easy way to do this. You could set up a publish configuration and use csproj magic to exclude certain files and dependencies for publish configuration. But that's incredibly non-traditional and will not be read well by future developers. Having separate src/ and test/ projects is the more idiomatic way. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
Does the Source Generator approach allow putting unit tests in the src assembly without increasing package size at publish to e.g. Nuget or single-binary files?
I have for a long time been looking for feasible alternatives to having src/ and tests/ folders where each src project has an equivalent test project. I like the structure in src/ and tests/ projects to align, and it can be challenging and time-consuming when the projects change idependently. In many other programming languages tests are written side-by-side with the src code matching my preference. In dotnet test frameworks this preference has not been well supported historically, as it will increase the published package size.
Beta Was this translation helpful? Give feedback.
All reactions