Access Internals from different assemblies

It is always good to reflect what access modifier that should be used when and where. In my current hobby project I found myself exposing really dangerous methods, like


Why? Well, I wanted to test this method, and the unit test of course lays in a different assembly.

May I remind everyone, that it is not necessary! What you want to do is use the InternalsVisibleTo attribute.

In the AssemblyInfo.cs for project that has methods you want to test, just add something like this:

[assembly: InternalsVisibleTo("MyApplication.Core.Tests")]

Thank you a lot for that, Microsoft!