I have a class similar to below:
public class StaticPropertyClass
{
protected static string StaticProperty
{
get
{
return "foo";
}
}
}
How can I mock StaticProperty?
Isolate.Fake.StaticMethods(typeof(StaticPropertyClass));
Isolate.WhenCalled(() => StaticPropertyClass.StaticProperty).WillReturn("bar");
Does not work because there are complaints about StaticProperty not being accessable.
Isolate.NonPublic.WhenCalled(...).WillReturn("bar");
Appears to only work for instance members. How to do this for non-public, static members? I understand that fields are not possible, but how about Methods/Properties?
dmp