Hi,
Isolator 6.0 has a new feature that identifies nested calls which are not supported in
WhenCalled and
Verify. Nested calls where not supported in previous versions of Isolator and led to wrong behavior recording. The new version reduces it by notifying during the behavior recording.
The correct code should be:
var arg = Something.Other().GetStuff();
Isolate.WhenCalled(() => ObjUnderTest.MethodUnderTest(arg))
.WithExactArguments().WillReturn(...) // Specific arguments
Isolate.WhenCalled(() => ObjUnderTest.MethodUnderTest(null)).WillReturn(...) // Match all arguments
In the code the nested call result is stored in a variable before the behavior recording and avoids the nested call.
Regards,
Elisha,
Typemock Support