28
votes

In .NET Core under Visual Studio 2015 one had to create a unit test project that was based on xunit, though the command line (no dedicated project was available in Visual Studio for .NET Core).

In Visual Studio 2017, under .NET Core section there are now 2 types of unit testing projects available:

  1. Unit Test Project (.NET Core)
  2. xUnit Test Project (.NET Core)

What is the difference between them? What is the recommended one these days?

2

2 Answers

10
votes

Unit Test Project has MSTest V2 framework installed.

xUnit Test Project has xUnit.

It's just two different test frameworks.

Unit Testing in .NET Core.

1
votes

They are completely 2 different Unit Test Frameworks. There is some basic information/documentation available for xUnit at http://xunit.github.io for xUnit but not a full one. The answer to: "What is the recommended one these days?" It depends on your personal preference. I prefer xUnit because xUnit integrates well with Visual Studio and is used by Microsoft team to test .net core. You can chose whichever you find suitable.