Tag Archives: c#

Unit testing .net / C# private methods

Putting aside arguments about whether private methods should be tested, I’m amazed the PrivateObject class hasn’t received more coverage.

It has been in the framework since VS2005 yet people are still recommending we mark private methods as internal and use the InternalsVisibleToAttribute.

This blog nicely describes how to use PrivateObject.