Static mock doesn't work for Windows Universal unit tests

1 posts, 0 answers
  1. Anton
    Anton avatar
    4 posts
    Member since:
    Mar 2015

    Posted 15 May 2015 Link to this post

    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.

     

Back to Top