Is it possible to get access to a private static field inside a static class, using the VS2010 Unit Test class PrivateObject ?
Let say i have the following class:
public static class foo
{
private static bar;
}
Can i use PrivateObject to create a copy of foo, and then get the bar field?
The property value can be retreived using reflection. This will require the use of Type.GetField Method (String, BindingFlags) and the FieldInfo.GetValue Method