JustMock

MSBuild is the build system for Microsoft and Visual Studio. It is completely transparent in processing and building software, enabling developers to build products in development environments where Visual Studio is not present.

MSBuild uses a simple and extensible XML file format that is fully supported by Microsoft. It enables developers to fully describe what items need to be built and how they need to be built in different configurations.

This topic demonstrates how to integrate Telerik JustMock with a MSBuild task

MS Build tasks are units of executable code to perform build operations. Once created, tasks can be shared among different developers to be reused in different projects.

To learn more about MSBuild refer to MSDN Library.

How to run your unit tests from a MSBuild task

  1. Open your MSBuild project and under the Project node include Telerik JustMock targets file. This file is named JustMock.targets and can be found in the installation directory under the Libraries folder (by default C:\Program Files\Telerik\JustMock\Libraries\).

    CopyXML
    <Import Project="C:\Program Files (x86)\Telerik\JustMock\Libraries\JustMock.targets" />

    Note
    Remember to change the targets file path to the one specific for you system.
  2. Add the following two tasks under the Project node to start and stop Telerik JustMock respectively before and after the tests run:

    CopyXML
    <Target Name="BeforeTestConfiguration">
      <JustMockStart />
    </Target>
    
    <Target Name="AfterTestConfiguration">
      <JustMockStop />
    </Target>

See Also