How to run tests with Mock.SetupStatic using MSTEST

3 posts, 0 answers
  1. Max
    Max avatar
    2 posts
    Member since:
    Feb 2009

    Posted 17 Jul 2012 Link to this post

    I am new to the framework so I guess it is just something I did not do before invoke the test case using MSTEST.

    Created the test as following

            public class Foo
                public static int Execute(int arg) { throw new NotImplementedException(); }

            public void TestMethod1()
                Mock.Arrange(() => Foo.Execute(0)).Returns(10);

    Got a passed test case within VS2012 environment. 

    When I do commandline "mstest /testcontainer:test.dll", the case failed. Anything I need to do before running MSTEST?

  2. Max
    Max avatar
    2 posts
    Member since:
    Feb 2009

    Posted 19 Jul 2012 Link to this post

    Sorry for starting this thread. I am just a bit hasty. I should read through the help file completely before posting this question.

    Just for information, use JustMockRunner.exe as a wrapper application then the case will pass.

  3. Ricky
    Ricky avatar
    467 posts

    Posted 20 Jul 2012 Link to this post

    Hi Max,

    It's great that you have figured it out. Should you need any other information please don't hesitate contact us.


    Kind Regards
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top