Shouldly
Search…
Shouldly
Overview
Contributing
Documentation
Getting Started
Configuration
Equality
ShouldBe
NotBe
Null
Bool
Flags
AssignableTo
OfType
OneOf
Greater/Less Than
InRange
MatchApproved
Enumerable
SameAs
String
ExampleClasses
String
Enumerable
Dictionary
Exceptions
SatisfyAllConditions
CompleteIn
DynamicShould
Upgrade 3 to 4
Powered By
GitBook
InRange
ShouldBeInRange
is the inverse of
ShouldNotBeInRange
.
ShouldBeInRange
1
var
homer
=
new
Person
{
Name
=
"Homer"
,
Salary
=
300000000
};
2
homer
.
Salary
.
ShouldBeInRange
(
30000
,
40000
);
Copied!
snippet source
|
anchor
Exception
1
homer.Salary
2
should be in range
3
{ from = 30000, to = 40000 }
4
but was
5
300000000
Copied!
ShouldNotBeInRange
1
var
mrBurns
=
new
Person
{
Name
=
"Mr. Burns"
,
Salary
=
30000
};
2
mrBurns
.
Salary
.
ShouldNotBeInRange
(
30000
,
40000
);
Copied!
snippet source
|
anchor
Exception
1
mrBurns.Salary
2
should not be in range
3
{ from = 30000, to = 40000 }
4
but was
5
30000
Copied!
Previous
Greater/Less Than
Next
MatchApproved
Last modified
1yr ago
Copy link
Contents
ShouldBeInRange
ShouldNotBeInRange