@@ -11,7 +11,7 @@ public class RequestHandlerSettingsTests
11
11
[ Test ]
12
12
public void Given_CharCollection_With_DefaultEnabled_MergesCollection ( )
13
13
{
14
- var userCollection = new CharacterReplacement [ ]
14
+ var userCollection = new CharItem [ ]
15
15
{
16
16
new ( ) { Char = "test" , Replacement = "replace" } ,
17
17
new ( ) { Char = "test2" , Replacement = "replace2" }
@@ -31,10 +31,10 @@ public void Given_CharCollection_With_DefaultEnabled_MergesCollection()
31
31
[ Test ]
32
32
public void Given_CharCollection_With_DefaultDisabled_ReturnsUserCollection ( )
33
33
{
34
- var userCollection = new CharacterReplacement [ ]
34
+ var userCollection = new CharItem [ ]
35
35
{
36
- new ( ) { Char = "test" , Replacement = "replace" } ,
37
- new ( ) { Char = "test2" , Replacement = "replace2" }
36
+ new ( ) { Char = "test" , Replacement = "replace" } ,
37
+ new ( ) { Char = "test2" , Replacement = "replace2" }
38
38
} ;
39
39
40
40
var settings = new RequestHandlerSettings { CharCollection = userCollection , EnableDefaultCharReplacements = false } ;
@@ -47,31 +47,31 @@ public void Given_CharCollection_With_DefaultDisabled_ReturnsUserCollection()
47
47
[ Test ]
48
48
public void Given_CharCollection_That_OverridesDefaultValues_ReturnsReplacements ( )
49
49
{
50
- var userCollection = new CharacterReplacement [ ]
50
+ var userCollection = new CharItem [ ]
51
51
{
52
- new ( ) { Char = "%" , Replacement = "percent" } ,
53
- new ( ) { Char = "." , Replacement = "dot" }
52
+ new ( ) { Char = "%" , Replacement = "percent" } ,
53
+ new ( ) { Char = "." , Replacement = "dot" }
54
54
} ;
55
55
56
56
var settings = new RequestHandlerSettings { CharCollection = userCollection } ;
57
57
var actual = settings . GetCharReplacements ( ) . ToList ( ) ;
58
58
59
59
Assert . AreEqual ( RequestHandlerSettings . DefaultCharCollection . Length , actual . Count ) ;
60
60
61
- Assert . That ( actual , Has . Exactly ( 1 ) . Matches < CharacterReplacement > ( x => x . Char == "%" && x . Replacement == "percent" ) ) ;
62
- Assert . That ( actual , Has . Exactly ( 1 ) . Matches < CharacterReplacement > ( x => x . Char == "." && x . Replacement == "dot" ) ) ;
63
- Assert . That ( actual , Has . Exactly ( 0 ) . Matches < CharacterReplacement > ( x => x . Char == "%" && x . Replacement == string . Empty ) ) ;
64
- Assert . That ( actual , Has . Exactly ( 0 ) . Matches < CharacterReplacement > ( x => x . Char == "." && x . Replacement == string . Empty ) ) ;
61
+ Assert . That ( actual , Has . Exactly ( 1 ) . Matches < CharItem > ( x => x . Char == "%" && x . Replacement == "percent" ) ) ;
62
+ Assert . That ( actual , Has . Exactly ( 1 ) . Matches < CharItem > ( x => x . Char == "." && x . Replacement == "dot" ) ) ;
63
+ Assert . That ( actual , Has . Exactly ( 0 ) . Matches < CharItem > ( x => x . Char == "%" && x . Replacement == string . Empty ) ) ;
64
+ Assert . That ( actual , Has . Exactly ( 0 ) . Matches < CharItem > ( x => x . Char == "." && x . Replacement == string . Empty ) ) ;
65
65
}
66
66
67
67
[ Test ]
68
68
public void Given_CharCollection_That_OverridesDefaultValues_And_ContainsNew_ReturnsMergedWithReplacements ( )
69
69
{
70
- var userCollection = new CharacterReplacement [ ]
70
+ var userCollection = new CharItem [ ]
71
71
{
72
- new ( ) { Char = "%" , Replacement = "percent" } ,
73
- new ( ) { Char = "." , Replacement = "dot" } ,
74
- new ( ) { Char = "new" , Replacement = "new" }
72
+ new ( ) { Char = "%" , Replacement = "percent" } ,
73
+ new ( ) { Char = "." , Replacement = "dot" } ,
74
+ new ( ) { Char = "new" , Replacement = "new" }
75
75
} ;
76
76
77
77
var settings = new RequestHandlerSettings { CharCollection = userCollection } ;
@@ -80,11 +80,11 @@ public void Given_CharCollection_That_OverridesDefaultValues_And_ContainsNew_Ret
80
80
// Add 1 to the length, because we're expecting to only add one new one
81
81
Assert . AreEqual ( RequestHandlerSettings . DefaultCharCollection . Length + 1 , actual . Count ) ;
82
82
83
- Assert . That ( actual , Has . Exactly ( 1 ) . Matches < CharacterReplacement > ( x => x . Char == "%" && x . Replacement == "percent" ) ) ;
84
- Assert . That ( actual , Has . Exactly ( 1 ) . Matches < CharacterReplacement > ( x => x . Char == "." && x . Replacement == "dot" ) ) ;
85
- Assert . That ( actual , Has . Exactly ( 1 ) . Matches < CharacterReplacement > ( x => x . Char == "new" && x . Replacement == "new" ) ) ;
86
- Assert . That ( actual , Has . Exactly ( 0 ) . Matches < CharacterReplacement > ( x => x . Char == "%" && x . Replacement == string . Empty ) ) ;
87
- Assert . That ( actual , Has . Exactly ( 0 ) . Matches < CharacterReplacement > ( x => x . Char == "." && x . Replacement == string . Empty ) ) ;
83
+ Assert . That ( actual , Has . Exactly ( 1 ) . Matches < CharItem > ( x => x . Char == "%" && x . Replacement == "percent" ) ) ;
84
+ Assert . That ( actual , Has . Exactly ( 1 ) . Matches < CharItem > ( x => x . Char == "." && x . Replacement == "dot" ) ) ;
85
+ Assert . That ( actual , Has . Exactly ( 1 ) . Matches < CharItem > ( x => x . Char == "new" && x . Replacement == "new" ) ) ;
86
+ Assert . That ( actual , Has . Exactly ( 0 ) . Matches < CharItem > ( x => x . Char == "%" && x . Replacement == string . Empty ) ) ;
87
+ Assert . That ( actual , Has . Exactly ( 0 ) . Matches < CharItem > ( x => x . Char == "." && x . Replacement == string . Empty ) ) ;
88
88
}
89
89
}
90
90
}
0 commit comments