Windows Batch Command

Another way to execute test DLLs is via the Command Prompt(cmd.exe).

This topic demonstrates how to execute TelerikĀ® JustMock test DLLs with cmd.exe.

How to Run Profiler Enabled JustMock Tests in Command Prompt

The procedure of executing test DLLs in Command Prompt is almost identical regardless of the different unit testing frameworks that you may use.

Your first step will be setting the JustMock environment variables, for which there are two possible approaches.

  • We recommend using JustMock Runner. It will automatically setup an appropriate environment for our product.

    JustMockRunner.exe can be found in the JustMock installation directory under the Libraries folder (by default C:\Program Files (x86)\Progress\Telerik JustMock\Libraries).

    Below you will find an example batch file, that will use MSTest to run all the tests in Telerik.JustMock.Test.DLL (found in the Telerik.JustMock.CSExamples.VS2010.sln inside Telerik JustMock root folder).

    Windows Batch Command 1

    Execution command:

    "C:\Program Files (x86)\Telerik\JustMock\Libraries\JustMockRunner.exe" "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testcontainer:"C:\Program Files (x86)\Telerik\JustMock\Examples\Telerik.JustMock.Tests\bin\Debug\Telerik.JustMock.Tests.dll"

  • If for any reason using JustMock Runner does not apply to your case, it is possible to set the JustMock environment variables manually before running the tests:

    Windows Batch Command 2

    Execution command:

    SET JUSTMOCK_INSTANCE=1

    SET COR_ENABLE_PROFILING=1

    SET COR_PROFILER={B7ABE522-A68F-44F2-925B-81E7488E9EC0}

    "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testcontainer:"C:\Program Files (x86)\Telerik\JustMock\Examples\Telerik.JustMock.Tests\bin\Debug\Telerik.JustMock.Tests.dll"

As shown above, once the environment variables are set, you will be able to run elevated JustMock tests through the Command Prompt, simply by following the standard steps for the chosen unit testing framework.

In this article
Not finding the help you need? Improve this article