NUnit
From Logic Wiki
Starting Up
- install nUnit nuget packages
- Add a new class project
- Right click "References" add project reference to test project
Simple Test
using NUnit.Framework;
using Logicom.Models;
namespace Logicom.Tests.Security
{
[TestFixture]
public class password_policyTests
{
password_policy sut = new password_policy(1, 8, 1, 1, 1, 1, 1, 3, 3);
[Test]
public void ShouldRejectPasswordIfItsLessThenMinLenght()
{
var result = sut.CheckPassword("Passwor"); // 7 char long
Assert.That(result = false, "it's rejected");
}
[Test]
public void ShouldRejectPasswordIfItsLessThenMinLenght()
{
var result = sut.CheckPassword("Passwor"); // 7 char long
Assert.That(result, Is.EqualTo(true));
}
}
}