Funicular-Switch icon indicating copy to clipboard operation
Funicular-Switch copied to clipboard

Do not generate fluent assertion extensions for types that are not public

Open JMarianczuk opened this issue 2 years ago • 1 comments

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

JMarianczuk avatar Jul 25 '23 10:07 JMarianczuk

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)]

JMarianczuk avatar Jul 25 '23 10:07 JMarianczuk