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
Working through the examples there are some unit tests that have some Isolate attributes on them, and some that don't. There are also some 'pre/post' calls on some files for Verify and ClearAll.

Being a newb to Typemock when is the correct type (and incorrect times) to use these methods? Looking at the comments I didn't really undertand why it would be there in some case and not in others.
asked by boo (21.8k points)

1 Answer

0 votes
Hi Brian,

Here's a recap of our attributes. There are 3. Most of them do the same thing - clean up the mocks after the test. The first two work with Reflective and Natural mocks:

ClearMocks - Just cleans up. The equivalent of MockManager.ClearAll()
VerifyMocks - Verify all expectations and cleans up. The equivalent of MockManager.Verify()

:arrow: Don't use both attributes together. Select the one you need.

The Isolated is part of the new API (Arrange-Act-Assert) which does basically the same, and can be substituted with Isolate.CleanUp() at the end of the test. You need to use either.

I hope that makes it clearer. Let me know if you need more explanations.


answered by gilz (14.5k points)