1+ using System . Text . RegularExpressions ;
12using Mockolate . Web ;
23
34namespace Mockolate . Tests . Web ;
@@ -111,11 +112,14 @@ public async Task WithFormData_StringMultiple_ShouldReturnExpectedValue()
111112 public async Task WithHeaders_Multiple_ShouldReturnExpectedValue ( )
112113 {
113114 ItExtensions . IHttpContentParameter sut =
114- It . IsHttpContent ( ) . WithHeaders ( ( "x-my-header" , "my-value" ) , ( "x-my-other-header" , "my-other-value" ) ) ;
115+ It . IsHttpContent ( )
116+ . WithHeaders ( ( "x-my-header" , "my-value" ) , ( "x-my-other-header" , "my-other-value" ) ) ;
115117
116118 string ? result = sut . ToString ( ) ;
117119
118- await That ( result ) . IsEqualTo ( "Http content with headers \" x-my-header: my-value\" , \" x-my-other-header: my-other-value\" " ) ;
120+ await That ( result )
121+ . IsEqualTo (
122+ "Http content with headers \" x-my-header: my-value\" , \" x-my-other-header: my-other-value\" " ) ;
119123 }
120124
121125 [ Fact ]
@@ -161,6 +165,17 @@ public async Task WithMediaTypeViaFactory_ShouldReturnExpectedValue()
161165 await That ( result ) . IsEqualTo ( "Http content with media type \" application/json\" " ) ;
162166 }
163167
168+ [ Fact ]
169+ public async Task WithString_Exactly_IgnoringCase_ShouldReturnExpectedValue ( )
170+ {
171+ ItExtensions . IStringContentBodyParameter sut = It . IsHttpContent ( ) . WithString ( "foo" ) . Exactly ( )
172+ . IgnoringCase ( ) ;
173+
174+ string ? result = sut . ToString ( ) ;
175+
176+ await That ( result ) . IsEqualTo ( "string content equal to \" foo\" ignoring case" ) ;
177+ }
178+
164179 [ Fact ]
165180 public async Task WithString_Exactly_ShouldReturnExpectedValue ( )
166181 {
@@ -192,6 +207,29 @@ public async Task WithString_ShouldReturnExpectedValue()
192207 await That ( result ) . IsEqualTo ( "string content containing \" foo\" " ) ;
193208 }
194209
210+ [ Fact ]
211+ public async Task WithStringMatching_AsRegex_IgnoringCase_ShouldReturnExpectedValue ( )
212+ {
213+ ItExtensions . IStringContentBodyParameter sut =
214+ It . IsHttpContent ( ) . WithStringMatching ( "^foo" ) . AsRegex ( ) . IgnoringCase ( ) ;
215+
216+ string ? result = sut . ToString ( ) ;
217+
218+ await That ( result ) . IsEqualTo ( "string content matching regex pattern \" ^foo\" ignoring case" ) ;
219+ }
220+
221+ [ Fact ]
222+ public async Task WithStringMatching_AsRegex_IgnoringCase_WithOptions_ShouldReturnExpectedValue ( )
223+ {
224+ ItExtensions . IStringContentBodyParameter sut =
225+ It . IsHttpContent ( ) . WithStringMatching ( "^foo" ) . AsRegex ( RegexOptions . Multiline ) . IgnoringCase ( ) ;
226+
227+ string ? result = sut . ToString ( ) ;
228+
229+ await That ( result )
230+ . IsEqualTo ( "string content matching regex pattern \" ^foo\" ignoring case with options Multiline" ) ;
231+ }
232+
195233 [ Fact ]
196234 public async Task WithStringMatching_AsRegex_ShouldReturnExpectedValue ( )
197235 {
@@ -203,6 +241,28 @@ public async Task WithStringMatching_AsRegex_ShouldReturnExpectedValue()
203241 await That ( result ) . IsEqualTo ( "string content matching regex pattern \" ^foo\" " ) ;
204242 }
205243
244+ [ Fact ]
245+ public async Task WithStringMatching_AsRegex_WithOptions_ShouldReturnExpectedValue ( )
246+ {
247+ ItExtensions . IStringContentBodyParameter sut =
248+ It . IsHttpContent ( ) . WithStringMatching ( "^foo" ) . AsRegex ( RegexOptions . Multiline ) ;
249+
250+ string ? result = sut . ToString ( ) ;
251+
252+ await That ( result ) . IsEqualTo ( "string content matching regex pattern \" ^foo\" with options Multiline" ) ;
253+ }
254+
255+ [ Fact ]
256+ public async Task WithStringMatching_IgnoringCase_ShouldReturnExpectedValue ( )
257+ {
258+ ItExtensions . IStringContentBodyParameter sut =
259+ It . IsHttpContent ( ) . WithStringMatching ( "*foo*" ) . IgnoringCase ( ) ;
260+
261+ string ? result = sut . ToString ( ) ;
262+
263+ await That ( result ) . IsEqualTo ( "string content matching pattern \" *foo*\" ignoring case" ) ;
264+ }
265+
206266 [ Fact ]
207267 public async Task WithStringMatching_ShouldReturnExpectedValue ( )
208268 {
0 commit comments