@@ -14,7 +14,7 @@ public class HelperTests
1414 [ InlineData ( " " ) ]
1515 public void ItShouldKeepItAsIs ( string input )
1616 {
17- var output = Helper . ReplaceAll ( input , "any" , x => x + "" ) ;
17+ var output = Helper . ReplaceAll ( input , "any" , " \\ " , x => x + "" ) ;
1818
1919 Assert . Equal ( input , output ) ;
2020 }
@@ -28,7 +28,7 @@ public void ItShouldKeepItAsIs(string input)
2828 [ InlineData ( " ? ? hello" , " @ @ hello" ) ]
2929 public void ReplaceOnTheBegining ( string input , string expected )
3030 {
31- var output = Helper . ReplaceAll ( input , "?" , x => "@" ) ;
31+ var output = Helper . ReplaceAll ( input , "?" , " \\ " , x => "@" ) ;
3232 Assert . Equal ( expected , output ) ;
3333 }
3434
@@ -39,19 +39,21 @@ public void ReplaceOnTheBegining(string input, string expected)
3939 [ InlineData ( "hello ? ?? ? " , "hello @ @@ @ " ) ]
4040 public void ReplaceOnTheEnd ( string input , string expected )
4141 {
42- var output = Helper . ReplaceAll ( input , "?" , x => "@" ) ;
42+ var output = Helper . ReplaceAll ( input , "?" , " \\ " , x => "@" ) ;
4343 Assert . Equal ( expected , output ) ;
4444 }
4545
4646 [ Theory ]
47+ [ InlineData ( "hel\\ ?o ??? " , "hel\\ ?o 012 " ) ]
48+ [ InlineData ( "hel\\ ?o ?? \\ ?" , "hel\\ ?o 01 \\ ?" ) ]
4749 [ InlineData ( "hello?" , "hello0" ) ]
4850 [ InlineData ( "hello? " , "hello0 " ) ]
4951 [ InlineData ( "hello??? " , "hello012 " ) ]
5052 [ InlineData ( "hel?lo ? ?? ? " , "hel0lo 1 23 4 " ) ]
5153 [ InlineData ( "????" , "0123" ) ]
5254 public void ReplaceWithPositions ( string input , string expected )
5355 {
54- var output = Helper . ReplaceAll ( input , "?" , x => x + "" ) ;
56+ var output = Helper . ReplaceAll ( input , "?" , " \\ " , x => x + "" ) ;
5557 Assert . Equal ( expected , output ) ;
5658 }
5759
@@ -220,7 +222,7 @@ public void ExpandExpression(string input, string expected)
220222 [ Fact ]
221223 public void ExpandParameters ( )
222224 {
223- var expanded = Helper . ExpandParameters ( "where id = ? or id in (?) or id in (?)" , "?" , new object [ ] { 1 , new [ ] { 1 , 2 } , new object [ ] { } } ) ;
225+ var expanded = Helper . ExpandParameters ( "where id = ? or id in (?) or id in (?)" , "?" , " \\ " , new object [ ] { 1 , new [ ] { 1 , 2 } , new object [ ] { } } ) ;
224226
225227 Assert . Equal ( "where id = ? or id in (?,?) or id in ()" , expanded ) ;
226228 }
0 commit comments