File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
docs/snippets/Snippets.NUnit Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,16 @@ public void EqualConstraint_FloatingPoint()
38
38
[ Test ]
39
39
public void EqualConstraint_Strings ( )
40
40
{
41
- Assert . That ( "Hello!" , Is . Not . EqualTo ( "HELLO!" ) ) ;
42
- Assert . That ( "Hello!" , Is . EqualTo ( "HELLO!" ) . IgnoreCase ) ;
41
+ string hello = "Hello!" ;
42
+ Assert . That ( hello , Is . Not . EqualTo ( "HELLO!" ) ) ;
43
+ Assert . That ( hello , Is . EqualTo ( "HELLO!" ) . IgnoreCase ) ; // Ignores case in both actual and expected before comparing
43
44
44
45
string [ ] expected = [ "Hello" , "World" ] ;
45
46
string [ ] actual = [ "HELLO" , "world" ] ;
46
47
Assert . That ( actual , Is . EqualTo ( expected ) . IgnoreCase ) ;
47
- Assert . That ( "Hello my world is \r \n on fire!" , Is . EqualTo ( "Hellomy world \r \n is on fire!" ) . IgnoreWhiteSpace ) ;
48
+ string actualiws = "Hello my world is \r \n on fire!" ;
49
+ string expectediws = "Hellomy world \r \n is on fire!" ;
50
+ Assert . That ( actualiws , Is . EqualTo ( expectediws ) . IgnoreWhiteSpace ) ; // Ignores white space in both actual and expected before comparing
48
51
}
49
52
#endregion
50
53
You can’t perform that action at this time.
0 commit comments