Funicular-Switch
Funicular-Switch copied to clipboard
Do not generate fluent assertion extensions for types that are not public
e.g. when there is
[UnionType]
internal abstract partial record SomeUnionType {}
then the fluent assertion extensions and assertions class should not be generated in the unit test project that references that project, because the compiler will complain that the internal class is not accessible
A workaround is to put
<InternalsVisibleTo Include="The.Test.Project" />
into the project with internal classes, but that is not a clean solution. When someone has declared <InternalsVisibleTo ... /> and wants to assert the internal types, maybe a global attribute is necessary to indicate that. Maybe something like
[global: GenerateExtensionsForInternalTypes(true)]