Visual Studio 2013/2015 Test project template - for NUnit?

I am new to unit testing and have started working with MSTest and want to use NUnit. I see that in VS 2015 there is a test project template, but I read that for NUnit I have to create a class library and then add the NUnit NuGet packages.

What is right? Check project template or class library for NUnit in C #?

thank

+4
source share
4 answers

In a test project, a project is created in which you can test Visual Studio. NUnit tests are performed externally. These are different options, each of which has different requirements.

If you want to make NUnit, follow the instructions of NUnit, create a class library and add NUnit packages.

+2

Visual Stusio NUnit, .

- nunit.framework.dll, NUnit.

NUnit Visual Studio:

  • nunit.framework.dll
  • test.cs
    • " NUnit.Framework;"
    • ( )

Test.cs :

using System;
using NUnit.Framework;

namespace NUnit.Tests
{
  [TestFixture]
  public class SuccessTests
  {
    [SetUp] public void Init()
    { /* ... */ }

    [TearDown] public void Dispose()
    { /* ... */ }

    [Test] public void Test1()
    { /* ... */ }
  }
}
  1. , .
+3

VS 2015 Unit Test, . NUnit, - , nuget . TDD , , .

+1

NUnit Visual Studio NUnit. Visual Studio, NUnit .

+1

Source: https://habr.com/ru/post/1599699/


All Articles