OK, I got it now.
I had to change the ShimBehaviors.InstanceBeahviour
property like so:
[TestMethod]
public void TestMethod1()
{
using (ShimsContext.Create())
{
var sutShim = new ShimPerson();
sutShim.DoSomething = () => { Console.WriteLine("Called from test"); };
sutShim.InstanceBehavior = ShimBehaviors.Fallthrough;
sutShim.Instance.SaveQuotes();
}
}
This tells Fakes to call the original SaveQuotes()
method, whilst still using the faked DoSomething()
method. I found this to be a good reference: