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
Is it a good idea to always put [Isolated] on tests, or is there a scenario where it is good to not put [Isolated] on a test?
asked by Neil (27.7k points)

4 Answers

0 votes
Hi Neil,

Yes it's highly recommended to add the Isolated attribute to you're tests.
Usually you'll want to add them in the class level so automatically the'll apply to all the test methods.

Putting the Isolate attribute clears up the fakes between each test and preventing unexpected errors that depends on the execution order of the tests.
answered by ohad (35.5k points)
0 votes
Hi Ohad,

If it is always good to use [Isolated], then could [Isolated] be removed from Isolator and replaced with Isolator automatically cleaning up fakes?
answered by Neil (27.7k points)
0 votes
Hi Neil,

Yes, it is a good idea. Actually it's one of our planned features :)
answered by ohad (35.5k points)
0 votes
Hi Ohad,

Splendid!
answered by Neil (27.7k points)
...