Shaun Abram
Technology and Leadership Blog
Testing private methods in .Net
Feeling the need to test private methods is usually a sign that your code needs refactoring. The recommended approach is that you test your code via it’s public interface. Since your private methods are only accessible via those public methods, it goes that if you have thoroughly testing via the public interface, your private methods will have been tested too.
Still, there can be times testing private methods can be useful. For example, while dealing with either legacy code or when using it as a temporary step while refactoring.
How do you do this in .Net?
Tags: dotnet, unittesting
Java vs .Net Accessor Modifiers
I’ve been looking at some .Net code recently, and I wanted to do some comparisons on Java access modifiers vs .Net to help me better understand the code.
Tags: access, accessmodifiers, dotnet, modifiers