Difference between revisions of "NUnit"
From Logic Wiki
(Created page with "Category:Tests Category:MVC Category:CSharp == Starting Up == * install nUnit nuget packages * Add a new class project * Right click "References" add project refe...") |
m (1 revision imported) |
(No difference)
| |
Latest revision as of 13:27, 9 May 2016
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));
}
}
}