So, I came across an issue today where I needed to test internal sealed classes in a separate testing project. Well, since you can’t instantiate internal sealed classes, I was in a tight spot.
So, I figured out a work around, and also discovered that there are resources out there on google that would have guided me towards this if I had just taken the time to search versus trying to figure it out on my own.
I remembered that in each project there is an AssemblyInfo.cs file. One of the assembly values is:
InternalsVisibleTo()
So, i set the following:
[assembly: InternalsVisibleTo("TestingProject.Tests")]
I compiled my project and went to my testing project. Behold, success!
I hope this helps others out there!
