C# unit test, how to test greater than
Assert.IsTrue(actualCount > 5, "The actualCount was not greater than five");
The right way to do this when using nUnit is:
Assert.That(actualcount , Is.GreaterThan(5));
It depends on which testing framework you're using.
For xUnit.net:
Assert.True(actualCount > 5, "Expected actualCount to be greater than 5.");
For NUnit:
Assert.Greater(actualCount, 5);
; however, the new syntax
Assert.That(actualCount, Is.GreaterThan(5));
is encouraged.
For MSTest:
Assert.IsTrue(actualCount > 5, "Expected actualCount to be greater than 5.");