chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
var count = 3;
var fakeCollection1 = Isolate.Fake.Instance<ICollection>();
var fakeCollection2 = Isolate.Fake.Instance<ICollection>();
Isolate.WhenCalled(() => fakeCollection1.Count).DoInstead(context => fakeCollection2.Count);
Isolate.WhenCalled(() => fakeCollection2.Count).WillReturn(count);
Assert.AreEqual(fakeCollection1.Count, count);
asked by KVN (600 points)

1 Answer

0 votes
Hi KVN,

Faking is turned off inside the DoInstead statement - this is a known limitation of DoInstead, which we are looking into resolving in a future version. Can you describe the testing scenario you need this usage for?

Thanks,
Doron
Typemock Support
answered by doron (17.2k points)
...