How to do it

  1. Open Visual Studio and create a new C# class library project, say ClassLibrary, with the following source code:
namespace ClassLibrary{  public class Class1  {    public bool Method1()    {      return true;    }    public bool Method2()    {      return false;    }    public bool Method3(Class1 c)    {      return c.Method1();    }    public bool Method4(Class1 c)    {      return c.Method2();    }  }}
  1. [NUnit] Add a C# unit test project, say NUnitBasedTestProject, to the solution and add a reference to ClassLibrary to this project.
  2. Open NuGet Package Manager for the project and uninstall the existing NuGet package references in MSTest.TestAdapter and MSTest.TestFramework:
  1. Add ...

Get Roslyn 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.