JustMock

This topic demonstrates how to use Telerik JustMock.

Prerequisites

Before proceeding further with Telerik JustMock make sure you have all the required components installed.

Using Telerik JustMock test project template

  1. Start by adding a new test project to your Solution. Right click on the Solution, select Add, then New Project....

    Add New Project
    Figure 1:Add New Project

  2. Select the Test Project template. Enter a Name and click OK.

    Choose the Test Project template
    Figure 2: Choose the Test Project template
  3. Using the default JustMock Test Project template, you can start writting JustMock tests right away.

Using Telerik JustMock in your test project

  1. If you want to apply Telerik JustMock to an existing unit test project, you will need to add a reference to Telerik.JustMock.dll. Right click on your test project and select Add Reference.

    Add Reference
    Figure 3:Add Reference
  2. Go to the Browse tab and navigate to the Libraries folder in the Telerik JustMock installation directory (by default C:\Program Files\Telerik\JustMock). Select Telerik.JustMock.dll and click OK.

    Select Telerik.JustMock.dll
    Figure 4: Select Telerik.JustMock.dll

    For Automocking, you will also need to add Telerik.JustMock.Container.DLL and have the Unity assemblies in the probing paths.

  3. Further, you will need to include the Telerik.JustMock namespace into your test project.

    Use Telerik.JustMock namespace
    Figure 5: Use Telerik.JustMock namespace
  4. Now, you are ready to use Telerik JustMock.

    Start writing your first test
    Figure 6: Start writing your first test

Using Telerik JustMock for testing Silverlight

There are several possible ways to test your Silverlight project with Telerik JustMock. For further details, check this article.

See Also