Shouldly
Search…
SatisfyAllConditions
1
var mrBurns = new Person { Name = null };
2
mrBurns.ShouldSatisfyAllConditions(
3
() => mrBurns.Name.ShouldNotBeNullOrEmpty(),
4
() => mrBurns.Name.ShouldBe("Mr.Burns"));
Copied!
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!
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!
Last modified 7mo ago
Copy link
Contents
Generic