@@ -8,6 +8,9 @@ This is a generated file, please edit src\FluentAssertions.Analyzers.FluentAsser
8
8
- [ StringShouldEndWith] ( #scenario-stringshouldendwith ) - ` actual.Should().EndWith(expected); `
9
9
- [ StringShouldNotBeNullOrEmpty] ( #scenario-stringshouldnotbenullorempty ) - ` actual.Should().NotBeNullOrEmpty(); `
10
10
- [ StringShouldBeNullOrEmpty] ( #scenario-stringshouldbenullorempty ) - ` actual.Should().BeNullOrEmpty(); `
11
+ - [ StringShouldBeNullOrWhiteSpace] ( #scenario-stringshouldbenullorwhitespace ) - ` actual.Should().BeNullOrWhiteSpace(); `
12
+ - [ StringShouldNotBeNullOrWhiteSpace] ( #scenario-stringshouldnotbenullorwhitespace ) - ` actual.Should().NotBeNullOrWhiteSpace(); `
13
+ - [ StringShouldHaveLength] ( #scenario-stringshouldhavelength ) - ` actual.Should().HaveLength(expected); `
11
14
- [ CollectionShouldNotBeEmpty] ( #scenario-collectionshouldnotbeempty ) - ` collection.Should().NotBeEmpty(); `
12
15
- [ CollectionShouldBeEmpty] ( #scenario-collectionshouldbeempty ) - ` collection.Should().BeEmpty(); `
13
16
- [ CollectionShouldNotContainCondition] ( #scenario-collectionshouldnotcontaincondition ) - ` collection.Should().NotContain(i => i == 4); `
@@ -160,6 +163,86 @@ string.IsNullOrEmpty(actual).Should().BeTrue(); // fail message: Expected strin
160
163
actual .Should ().BeNullOrEmpty (); // fail message: Expected actual to be <null> or empty, but found "actual".
161
164
```
162
165
166
+ ### scenario: StringShouldBeNullOrWhiteSpace
167
+
168
+ ``` cs
169
+ // arrange
170
+ var actual = string .Empty ;
171
+
172
+ // old assertion:
173
+ string .IsNullOrWhiteSpace (actual ).Should ().BeTrue ();
174
+
175
+ // new assertion:
176
+ actual .Should ().BeNullOrWhiteSpace ();
177
+ ```
178
+
179
+ #### Failure messages
180
+
181
+ ``` cs
182
+ // arrange
183
+ var actual = " actual" ;
184
+
185
+ // old assertion:
186
+ string .IsNullOrWhiteSpace (actual ).Should ().BeTrue (); // fail message: Expected string.IsNullOrWhiteSpace(actual) to be True, but found False.
187
+
188
+ // new assertion:
189
+ actual .Should ().BeNullOrWhiteSpace (); // fail message: Expected actual to be <null> or whitespace, but found "actual".
190
+ ```
191
+
192
+ ### scenario: StringShouldNotBeNullOrWhiteSpace
193
+
194
+ ``` cs
195
+ // arrange
196
+ var actual = " actual" ;
197
+
198
+ // old assertion:
199
+ string .IsNullOrWhiteSpace (actual ).Should ().BeFalse ();
200
+
201
+ // new assertion:
202
+ actual .Should ().NotBeNullOrWhiteSpace ();
203
+ ```
204
+
205
+ #### Failure messages
206
+
207
+ ``` cs
208
+ // arrange
209
+ var actual = string .Empty ;
210
+
211
+ // old assertion:
212
+ string .IsNullOrWhiteSpace (actual ).Should ().BeFalse (); // fail message: Expected string.IsNullOrWhiteSpace(actual) to be False, but found True.
213
+
214
+ // new assertion:
215
+ actual .Should ().NotBeNullOrWhiteSpace (); // fail message: Expected actual not to be <null> or whitespace, but found "".
216
+ ```
217
+
218
+ ### scenario: StringShouldHaveLength
219
+
220
+ ``` cs
221
+ // arrange
222
+ var actual = " actual" ;
223
+ var expected = 6 ;
224
+
225
+ // old assertion:
226
+ actual .Length .Should ().Be (expected );
227
+
228
+ // new assertion:
229
+ actual .Should ().HaveLength (expected );
230
+ ```
231
+
232
+ #### Failure messages
233
+
234
+ ``` cs
235
+ // arrange
236
+ var actual = " actual" ;
237
+ var expected = 5 ;
238
+
239
+ // old assertion:
240
+ actual .Length .Should ().Be (expected ); // fail message: Expected actual.Length to be 5, but found 6.
241
+
242
+ // new assertion:
243
+ actual .Should ().HaveLength (expected ); // fail message: Expected actual with length 5, but found string "actual" with length 6.
244
+ ```
245
+
163
246
### scenario: CollectionShouldNotBeEmpty
164
247
165
248
``` cs
0 commit comments