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
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
Using this simple test fails:

public void DoIt()
var lab = Isolate.Fake.Instance<LabBLL>();
Isolate.WhenCalled(() => lab.LabId).WillReturn(10);
Isolate.WhenCalled(() => lab.LabId).WillReturn(11);
Assert.AreEqual(11, lab.LabId);

Expected: 10
But was: 11

What am I doing wrong?


Matt B.
asked by MBeckius (5.4k points)

2 Answers

0 votes
Hi Matt,

Your test seems fine. I've tried running it and it worked ok.

Do you have Isolated attribute on the test class or on the test method?
If you do not use Isolated data from previous tests won't be cleaned and could cause strange behavior similar to what you've reported.
answered by dhelper (11.9k points)
0 votes

I looked at our release archives and it turns out behavior sequencing (which is what you are trying to do) was only added at a later release (which has been out for a while now). Is there anything preventing you from upgrading to our latest version (5.3.1)? That will solve this issue.

Typemock Support
answered by doron (17.2k points)