3 ms·
This exists (in kind of a hacky way) in C# with the ExternalsVisibleTo attribute. It exposes methods and classes only to specified assemblies (like your unit te
by mvdtnz 3y ago
This exists (in kind of a hacky way) in C# with the ExternalsVisibleTo attribute. It exposes methods and classes only to specified assemblies (like your unit test assemblies).
https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.internalsvisibletoattribute?view=net-7.0 https://learn.microsoft.com/en-us/dotnet/api/system.runtime....
- no_butterscotch 3y agoThis exists in many Java based languages, an annotation above a method: @VisibleForTesting or some such.
- gregoryl 3y agoYou can actually stick this in your csproj. I'm on a phone, so bear with me, but roughly <InternalsVisibleTo Include="assemblyname" /> Which means you can do stuff with msbuild props, like auto including a `$(assemblyname).Tests` into your projects.