It seems I always forget about the InternalsVisibleTo attribute which allows you to specify which external assembly can see your internal types and type members:
Internal classes need to be tested and there is an assembly attribute:
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleTo("MyTests")]Add this to the project info file, e.g. Properties\AssemblyInfo.cs.
Thanks Eric Schaefer for that answer.
–jeroen
via .net – C# “internal” access modifier when doing unit testing – Stack Overflow.