Hi everyone.
I'm having a weird problem with the the JustMock.Assert() method and "Running All Tests" in the solution.
I wrote a solution having < 50 unit tests. In these tests, I'm using the Mock.Assert(), and the .OccursOnce() quite often. Now if I run all these tests at once using the "Run All Tests in Solution" Button some of these fail. But when I run the failing tests once again, they pass.
This means, that I always have to run the unit test twice to get my solution green.
It seems, that this problem appears, when Mocking the same objects in different test cases.
One sample exception of such test would be:
Test method [methodname] threw exception:
Telerik.JustMock.MockAssertionException: Expected SAPtoADZipper.Zip(List`1) call on the mock should be once, but it was called 0 time(s).
I'm using Just Mock version 2011.1.315.0, and Microsoft.VisualStudio.TestTools.UnitTesting in Visual Studio 2010 with C# in the 3.5 .net Framework.
Does anyone have a hint for me, how to resolve this?
Maybe there's a way to mark the tests to run in an isolated Thread or something.
Thanks!
I'm having a weird problem with the the JustMock.Assert() method and "Running All Tests" in the solution.
I wrote a solution having < 50 unit tests. In these tests, I'm using the Mock.Assert(), and the .OccursOnce() quite often. Now if I run all these tests at once using the "Run All Tests in Solution" Button some of these fail. But when I run the failing tests once again, they pass.
This means, that I always have to run the unit test twice to get my solution green.
It seems, that this problem appears, when Mocking the same objects in different test cases.
One sample exception of such test would be:
Test method [methodname] threw exception:
Telerik.JustMock.MockAssertionException: Expected SAPtoADZipper.Zip(List`1) call on the mock should be once, but it was called 0 time(s).
I'm using Just Mock version 2011.1.315.0, and Microsoft.VisualStudio.TestTools.UnitTesting in Visual Studio 2010 with C# in the 3.5 .net Framework.
Does anyone have a hint for me, how to resolve this?
Maybe there's a way to mark the tests to run in an isolated Thread or something.
Thanks!