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
I ran into an issue where all our unit tests failed(ok, I mean, a lot of them) after I upgraded to 6.0. Then I downgraded to 5.4, they started working again. That means 6.0 has significant changes that are not backward compatible? Is there a documentation/reference for the areas affected?

Thanks
Merrin
asked by mkurian (1.8k points)

5 Answers

0 votes
Hi Merrin,

Isolator 6.0 didn't introduce new breaking changes. However, one thing I can think of causing tests to fail is improved errors detection Isolator 6.0 contains.

What happens when the tests fail? Does it throw an exception? Can you post example of the tests that fail?

Regards,
Elisha,
Typemock Support
answered by Elisha (12k points)
0 votes
Below is what I see for a failure. Looks like I need to refactor all unit tests to pass this.

TestCase 'UnitTests.Test_Method'
failed: TypeMock.ArrangeActAssert.NestedCallException :
*** WhenCalled does not support using a property call as an argument.
- To fix this pass null instead of ClassName.PropertyName

***
* Example - this would work:
- MyObj argument = Something.Other().GetStuff();
- Isolate.WhenCalled(() => ObjUnderTest.MethodUnderTest(argument))...;
***
* Example - this would not work:
- Isolate.WhenCalled(() => ObjUnderTest.MethodUnderTest(Something.Other().GetStuff()))...;
at cl.a()
at g0.a()
at da.a(Boolean A_0)
at de.b(Boolean A_0)
at il.c(Boolean A_0)
at il.c(Object A_0)
at TypeMock.ArrangeActAssert.ExpectationEngine`1.a(TResult A_0)
TestCodeB
answered by mkurian (1.8k points)
0 votes
The issue you've encountered is what we refer to as "chain within chain" you have a method call inside the method call you set behavior on.

This issue is not new - it's a known limitation we had since the first version OF AAA API.

The error message was added in the last version - but the functionality is the same as previous versions.
answered by dhelper (11.9k points)
0 votes
I am getting the NestedCallException when calling a static method that doesn't use nested chain calls:

Isolate.WhenCalled( () => ApplicationRecordTransformer.GetLateChargeAssessment( null ) ).WillReturn( "562.00" );


Error Message:
Test method FinanceSource.Core.Models.ServicesTests.Funding.RecordTransformerLeaseTest.TransformApplicationRecord_Should_Generate_Correct_Output_for_US threw exception: TypeMock.ArrangeActAssert.NestedCallException:
*** WhenCalled does not support using a method call as an argument.
- To fix this pass null instead of ApplicationRecordTransformer.GetLateChargeAssessment()

***
* Example - this would work:
- MyObj argument = Something.Other().GetStuff();
- Isolate.WhenCalled(() => ObjUnderTest.MethodUnderTest(argument))...;
***
* Example - this would not work:
- Isolate.WhenCalled(() => ObjUnderTest.MethodUnderTest(Something.Other().GetStuff()))...;
answered by dblack (8.4k points)
0 votes
Hi,

I couldn't reproduce the error here. Can you please post the code of the test and the relevant code from the method under test? If it's a problem to post the code you can email it to our support. I'll try to reproduce it here, it seems like a bug.

Regards,
Elisha,
Typemock Support
answered by Elisha (12k points)
...