I am trying to get some controller, model, and repository (data access) C# classes under unit test, in Visual Studio 2015, with ASP.NET Core MVC (ASP.NET 5 during the previe
With the release of RC2, the xUnit integration did not work any more with my projects (this has been fixed now see comments). To be able to test my projects I switched to NUnit. It appears to support RC2 and has a lightweight testrunner NUnitLite.
Basically you need to host the NUnitLite into a console application and start it with "dotnet run".
Add the following dependencies:
"dependencies": {
"NUnit": "3.2.1",
"NUnitLite": "3.2.1",
To start the test runner you need to add this code into the program.cs file:
public class Program
{
public static void Main(string[] args)
{
new AutoRun().Execute(args);
}
}