Hi,
I am not sure I understood what you meant.
If you want to verify that Statement was set to a specific value you can do it using the Verify methods. By the way, Isolator True Properties feature makes the test pass without setting "CallOriginal" on the properties.
For example:
var fake = Isolate.Fake.Instance<A>();
Isolate.SwapNextInstance<A>().With(fake);
var a = new A();
a.Statement = "A";
Isolate.Verify.WasCalledWithExactArguments(() => { fake.Statement = "A"; });
Assert.AreEqual("A", a.Statement);
If you want to perform an action when the value is being set you can do it using the "DoInstead" functinallity.
For example:
var fake = Isolate.Fake.Instance<A>();
Isolate.SwapNextInstance<A>().With(fake);
string propertValue = string.Empty;
Isolate.WhenCalled(() => fake.Statement)
.DoInstead(context => propertValue);
Isolate.WhenCalled(() => fake.Statement = "")
.DoInstead(context =>
{
propertValue = (string) context.Parameters[0];
return propertValue;
});
var a = new A();
a.Statement = "A";
Isolate.Verify.WasCalledWithExactArguments(() => { fake.Statement = "A"; });
Assert.AreEqual("A", a.Statement);
Please let me know if it helps.
Best Regards,
Elisha
Typemock Support Team