ShouldBeGreaterThan
is the inverse of ShouldBeLessThan
.
var mrBurns = new Person { Name = "Mr. Burns", Salary = 30000 };mrBurns.Salary.ShouldBeGreaterThan(300000000);
​snippet source | anchor
Exception
mrBurns.Salaryshould be greater than300000000but was30000
var mrBurns = new Person { Name = "Mr. Burns", Salary = 299999999 };mrBurns.Salary.ShouldBeGreaterThanOrEqualTo(300000000);
​snippet source | anchor
Exception
mrBurns.Salaryshould be greater than or equal to300000000but was299999999
var homer = new Person { Name = "Homer", Salary = 300000000 };homer.Salary.ShouldBeLessThan(30000);
​snippet source | anchor
Exception
homer.Salaryshould be less than30000but was300000000
var homer = new Person { Name = "Homer", Salary = 30001 };homer.Salary.ShouldBeLessThanOrEqualTo(30000);
​snippet source | anchor
Exception
homer.Salaryshould be less than or equal to30000but was30001