Home-made Private Accessor for Visual Studio 2012+

Why Home-made? Short answer: Starting with Visual Studio 2012, private accessors cannot be created any more by the IDE. It seems that this does not bother too many people. The ‘Bring Back Private Accessor’ suggestion on UserVoice has not found any supporters right now. Nevertheless, I still need access to …

Handling of Out-Parameters with .NET Reflection

Since Microsoft decided to remove the creation of private accessors for unit tests in Visual Studio 2012, one have to get familiar with the usage of Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject. This class offers an easy way to call methods, independent from their visibility, via reflection. The method is PrivateObject.Invoke. This method saves you …