You can modify the shim within the method call to replace it after the first one is complete:
[TestMethod]
public void TestMethod1()
{
using (ShimsContext.Create())
{
Something.Fakes.ShimClassA.MethodA = () =>
{
Something.Fakes.ShimClassA.MethodA = () =>
{
return "Second";
};
return "first";
};
var f = Something.ClassA.MethodA(); // first
var s = Something.ClassA.MethodA(); // second
var t = Something.ClassA.MethodA(); // second
}
var orig = Something.ClassA.MethodA(); // This will use the original implementation of MethodA
}