Nunit KT

  1.   Use NUnit for unit testing


need to add the following packages from NuGet.


2.[TestFixture] namesapce 

namespace NUnit.Tests
{
  using System;
  using NUnit.Framework;

  [TestFixture]
  public class SuccessTests
  {
    // ...
  }
}

Beginning with NUnit 2.5, the TestFixture attribute is optional for non-parameterized, non-generic fixtures. So long as the class contains at least one method marked with the TestTestCase or TestCaseSource attribute, it will be treated as a test fixture.


3.[Setup] attribute

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