class Parent{
public string Name{ get; set; }
}
class Child :Parent{
public string address{ get; set; }
}
[TestClass]
class TestClass{
[TestMethod]
public void TestMethod()
{
var c = new Fakes.Child();
c.addressGet = "foo"; // I can see that
c.NameGet = "bar"; // This DOES NOT exists
}
}
How can I set the "name" in the above code sample?
The generated class for Parent
will have a constructor that looks like: ShimParent(Parent p)
.
All you need to do is:
var child = new ShimChild();
var parent = new ShimParent(child);
And set the appropriate values on the respective Shim's.