This is a migrated thread and some comments may be shown as answers.

Static mock doesn't work for Windows Universal unit tests

0 Answers 8 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anton
Top achievements
Rank 1
Anton asked on 15 May 2015, 05:30 PM

Hi.

My configuration is: Visual Studio 2015 preview + JustMock Q2 2015 (2015.2.512.4)

Apparently static mocks don't work for me when i execute them from Windows Universal unit test project. It seems like the mock is not applied at all and the actual code is executed. For example here exception is not thrown:

Mock.SetupStatic(typeof(Assert), Behavior.Strict);
Mock.Arrange(() => Assert.IsTrue(Arg.AnyBool)).Throws(new ArgumentException());
Assert.IsTrue(true);

The same code though executes correctly and exception is thrown when i execute it from the regular unit test project.

Thank you.

 

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Anton
Top achievements
Rank 1
Share this question
or