Shouldly
Search…
Shouldly
Overview
Contributing
Documentation
Getting Started
Configuration
Equality
String
ShouldBe
Match
Contain
Null and Empty
StartWith
EndWith
Enumerable
Dictionary
Exceptions
SatisfyAllConditions
CompleteIn
DynamicShould
Upgrade 3 to 4
Powered By
GitBook
Null and Empty
ShouldBeNull
1
var
target
=
"Homer"
;
2
target
.
ShouldBeNull
();
Copied!
snippet source
|
anchor
Exception
1
target
2
should be null but was
3
"Homer"
Copied!
ShouldBeNullOrEmpty
1
var
target
=
"Homer"
;
2
target
.
ShouldBeNullOrEmpty
();
Copied!
snippet source
|
anchor
Exception
1
target ("Homer")
2
should be null or empty
Copied!
ShouldBeEmpty
1
var
target
=
"Homer"
;
2
target
.
ShouldBeEmpty
();
Copied!
snippet source
|
anchor
Exception
1
target
2
should be empty but was
3
"Homer"
Copied!
ShouldNotBeNull
1
string
?
target
=
null
;
2
target
.
ShouldNotBeNull
();
Copied!
snippet source
|
anchor
Exception
1
target
2
should not be null but was
Copied!
ShouldNotBeNullOrEmpty
1
var
target
=
""
;
2
target
.
ShouldNotBeNullOrEmpty
();
Copied!
snippet source
|
anchor
Exception
1
target ("")
2
should not be null or empty
Copied!
ShouldNotBeEmpty
1
var
target
=
""
;
2
target
.
ShouldNotBeNullOrEmpty
();
Copied!
snippet source
|
anchor
Exception
1
target
2
should not be empty but was
Copied!
Previous
Contain
Next
StartWith
Last modified
1yr ago
Copy link
Contents
ShouldBeNull
ShouldBeNullOrEmpty
ShouldBeEmpty
ShouldNotBeNull
ShouldNotBeNullOrEmpty
ShouldNotBeEmpty