I got a class that looks like this:
public class MyClass
{
int myNum;
private MyClass() {}
public static MyClass CreateInstance()
{
MyClass a = new MyClass();
a.myNum=5;
return a;
}
public bool IsBigger(MyClass b)
{
return this.myNum > b.myNum;
}
}
then, i want to make a shim of it and want to use the IsBigger method, but by default it returns false. How do i call the base method in this instance case ?
The test goes like this:
[TestMethod]
Public void test()
{
ShimMyClass firstShim = new ShimMyClass();
firstShim.myNumGet = () => { return 6; }
ShimMyClass secondShim = new ShimMyClass();
secondShim.myNumGet = () => { return 7; }
Assert.IsTrue(secondShim.Instance.IsBiggerThan(firstShim.Instance);
}