While working on class libraries, it’s a common and a good practice to unit test it before publishing. If you think about making implementation of interfaces hidden from other assemblies you may mark the class as internal. Unfortunately, it will make testing more difficult. Luckily there’s a way to handle it. All we need to do is finding our class library a friend. Friend assemblies can access internal types of another assembly.
I’ll present two ways of making a friend for the assembly:
- Use attribute
on any of classes
- Add following section to csproj file