Shouldly
Search…
Shouldly
Overview
Contributing
Documentation
Getting Started
Configuration
Equality
String
Enumerable
Dictionary
Exceptions
SatisfyAllConditions
CompleteIn
DynamicShould
Upgrade 3 to 4
Powered By
GitBook
SatisfyAllConditions
1
var
mrBurns
=
new
Person
{
Name
=
null
};
2
mrBurns
.
ShouldSatisfyAllConditions
(
3
()
=>
mrBurns
.
Name
.
ShouldNotBeNullOrEmpty
(),
4
()
=>
mrBurns
.
Name
.
ShouldBe
(
"Mr.Burns"
));
Copied!
snippet source
|
anchor
Exception
1
mrBurns
2
should satisfy all the conditions specified, but does not.
3
The following errors were found ...
4
--------------- Error 1 ---------------
5
mrBurns.Name (null)
6
should not be null or empty
7
8
--------------- Error 2 ---------------
9
mrBurns.Name
10
should be
11
"Mr.Burns"
12
but was
13
null
14
15
-----------------------------------------
Copied!
Generic
1
var
mrBurns
=
new
Person
{
Name
=
null
};
2
mrBurns
.
ShouldSatisfyAllConditions
(
3
p
=>
p
.
Name
.
ShouldNotBeNullOrEmpty
(),
4
p
=>
p
.
Name
.
ShouldBe
(
"Mr.Burns"
));
Copied!
snippet source
|
anchor
Exception
1
mrBurns
2
should satisfy all the conditions specified, but does not.
3
The following errors were found ...
4
--------------- Error 1 ---------------
5
p => p.Name (null)
6
should not be null or empty
7
8
--------------- Error 2 ---------------
9
p => p.Name
10
should be
11
"Mr.Burns"
12
but was
13
null
14
15
-----------------------------------------
Copied!
Previous
NotThrow
Next - Documentation
CompleteIn
Last modified
1yr ago
Copy link
Contents
Generic