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 Answers. Here you can ask and receive answers from other community members. And if you liked or disliked an answer or thread: react with an up- or downvote Enjoy!
+1 vote
We have coded a handful of tests, some of which use the TypeMock.Isolator.VisualBasic SwapAllInstances method. When running the tests that use SwapAllInstances individually, either the tests pass, or a different error is generated (differing for each test). When all tests are ran, the error "Can not call Swap.AllInstances() more than once on a type" is generated. Is there an issue with running multiple tests that use the SwapAllInstances Function?
asked by (1.2k points)

2 Answers

+1 vote
jdivis,

Do your tests have the [Isolated] attribute? This should ensure behavior is cleaned up between tests, allowing you to declare Swap.AllInstances() again. If this doesn't help, can you post your tests here (or send them to our support email)? I'm also interested in trying to help out with the tests that fail individually.

Thanks,
Doron
Typemock Support
answered by (16.5k points)
0 votes
doron,

Thank you for the suggestion. Just got back to these Unit Tests, tried your Isolated() attribute and that solved the swapallinstances issue.

I was able to resolve the other issues with the tests that were being masked by the "Can not call Swap.AllInstances() more than once on a type" error.

Thank you,

Jason
answered by (1.2k points)
...