28

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?

developer82
  • 13,237
  • 21
  • 88
  • 153

2 Answers2

10

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.

Ilya Chumakov
  • 23,161
  • 9
  • 86
  • 114
  • I suppose they could have done a better job of naming the MSTest one. – Gigi May 24 '17 at 19:44
  • 4
    Thanks for the answer, but unfortunately it does not answer my question to the differences between them (information which the documentation, which I've read, does not supply). – developer82 May 25 '17 at 03:56
  • 1
    I have opened an issue on the templating repo to suggest renaming: https://github.com/dotnet/templating/issues/858 – Martin Ullrich May 25 '17 at 06:00
  • 1
    @developer82 you asked about project types. Framework comparison is a good question for a mid-size technical article. Thanks for the idea. – Ilya Chumakov May 25 '17 at 06:05
  • @llya Which i should prefer for my .net core testing project? can you explain a bit. Thanks – Mogli Jun 01 '17 at 05:35
  • 4
    This does not answer the "What is the recommended one these days?" Question. – Daniel Santos Dec 12 '17 at 17:17
1

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.

Shuaib
  • 1,561
  • 3
  • 19
  • 28