Automatic Test Suggestions for a Specific Code

You can manually invoke automatic suggestion for any method. After tests are suggested, the Typemock Suggest window is displayed. Each test is accompanied with an icon that represents the status of the test:

Icon

Description

New test

Low quality test because:

There is no assertion in the method, or

The method uses a private method, or

The method is very simple

Such a test already exists.

If the code of the method was changed since the last automatic suggestion, Typemock Isolator will display a special notification.

You can choose whether to accept the automatically suggested tests or discard them.

To manually invoke automatic suggestion:

1. Open the class or method for which you want Typemock Isolator to suggest a test.

2. Right-click on the class or method.

Note:  In Visual Studio 2015 and higher you can also use Suggest on structures and their methods.

3. From the context menu, select one of the following:

If you clicked on a class, select Suggest Unit Tests for Class.

If you clicked on a method, select Suggest Unit Tests for Method.

The Typemock Suggest window is displayed.

4. Click See the Tests.

The Suggested Unit Tests window is displayed.

5. To preview the test, on the right from the test, click the test name.

The code of the test is displayed underneath the list of the suggested tests.

6. Do one of the following:

When you want to save the automatically suggested test, on the right from the test name, click Save. When you save a test for the first time for the solution, the Test Suggestion Settings window is displayed. In this window, you can specify where you want to save all automatically suggested tests. The location is stored in solution_name.isolator.config in the same folder where the solution is saved. To ensure that all automatically suggested tests are stored in the same location, share this file with the team.

When you want to discard the automatically suggested test, on the right from the test name, click Remove.

When you want different automatically suggested test or your code has changed, right-click on the test name, and in the context menu click Recalculate to change the test.

Also, by right-click the test name you can choose:

Goto Method to see the method under test.

Highlight Coverage to see the coverage provided by automatically suggested test.

Save to save automatically suggested test.

Remove to remove automatically suggested test from list.

Note:  The test will be removed only from the list in Typemock Suggest Window, not from the test class.