Creating tests using IntelliTest

IntelliTest allows developers to create and run tests against their code contracts. This allows developers to create the most robust code possible by creating additional code contracts to pass the test failures reported by IntelliTest. One thing to note, however, is that IntelliTest is included in the Visual Studio Enterprise only.

Getting ready

You will need to use Visual Studio Enterprise 2015 to be able to create and run IntelliTests.

How to do it…

  1. Before you go on, ensure that you have added the code contracts using statement to the top of your Recipes.cs class file:
    using System.Diagnostics.Contracts;
  2. Add a new class called CodeContractTests to your Recipes.cs file:
    public class CodeContractTests
    {    
    
    }
  3. Then, add a method ...

Get C# Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.