@@ -259,14 +259,18 @@ public class CollectionTests
259
259
260
260
[ AssertionDataTestMethod ]
261
261
[ AssertionDiagnostic ( "actual.Should().NotBeNull().And.NotBeEmpty({0});" ) ]
262
- [ NotImplemented ]
262
+ [ AssertionDiagnostic ( "actual.Should().NotBeEmpty().And.NotBeNull({0});" ) ]
263
+ [ Implemented ]
263
264
public void CollectionShouldNotBeNullOrEmpty_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < CollectionShouldNotBeNullOrEmptyAnalyzer > ( assertion ) ;
264
265
265
266
[ AssertionDataTestMethod ]
266
267
[ AssertionCodeFix (
267
- oldAssertion : "actual.Should().NotBeNull({0}).And.NotBeEmpty({0});" ,
268
- newAssertion : "actual.Should().NotBeNullOrEmpty({0});" ) ]
269
- [ NotImplemented ]
268
+ oldAssertion : "actual.Should().NotBeNull().And.NotBeEmpty({0});" ,
269
+ newAssertion : "actual.Should().NotBeNullOrEmpty({0});" ) ]
270
+ [ AssertionCodeFix (
271
+ oldAssertion : "actual.Should().NotBeEmpty().And.NotBeNull({0});" ,
272
+ newAssertion : "actual.Should().NotBeNullOrEmpty({0});" ) ]
273
+ [ Implemented ]
270
274
public void CollectionShouldNotBeNullOrEmpty_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldNotBeNullOrEmptyCodeFix , CollectionShouldNotBeNullOrEmptyAnalyzer > ( oldAssertion , newAssertion ) ;
271
275
272
276
[ AssertionDataTestMethod ]
@@ -326,15 +330,15 @@ public class CollectionTests
326
330
public void CollectionShouldBeInDescendingOrder_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldBeInDescendingOrderCodeFix , CollectionShouldBeInDescendingOrderAnalyzer > ( oldAssertion , newAssertion ) ;
327
331
328
332
[ AssertionDataTestMethod ]
329
- [ AssertionDiagnostic ( "actual.Select(e1 => e1.SomeProperty ).Should().Equal(expected.Select(e2 => e2.SomeProperty ){0});" ) ]
330
- [ NotImplemented ]
333
+ [ AssertionDiagnostic ( "actual.Select(e1 => e1.BooleanProperty ).Should().Equal(expected.Select(e2 => e2.BooleanProperty ){0});" ) ]
334
+ [ Implemented ]
331
335
public void CollectionShouldEqualOtherCollectionByComparer_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < CollectionShouldEqualOtherCollectionByComparerAnalyzer > ( assertion ) ;
332
336
333
337
[ AssertionDataTestMethod ]
334
338
[ AssertionCodeFix (
335
- oldAssertion : "actual.Select(e1 => e1.SomeProperty ).Should().Equal(expected.Select(e2 => e2.SomeProperty ){0});" ,
336
- newAssertion : "actual.Should().Equal(expected, (e1, e2) => e1.SomeProperty == e2.SomeProperty {0});" ) ]
337
- [ NotImplemented ]
339
+ oldAssertion : "actual.Select(e1 => e1.BooleanProperty ).Should().Equal(expected.Select(e2 => e2.BooleanProperty ){0});" ,
340
+ newAssertion : "actual.Should().Equal(expected, (e1, e2) => e1.BooleanProperty == e2.BooleanProperty {0});" ) ]
341
+ [ Implemented ]
338
342
public void CollectionShouldEqualOtherCollectionByComparer_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldEqualOtherCollectionByComparerCodeFix , CollectionShouldEqualOtherCollectionByComparerAnalyzer > ( oldAssertion , newAssertion ) ;
339
343
340
344
[ AssertionDataTestMethod ]
@@ -344,8 +348,8 @@ public class CollectionTests
344
348
345
349
[ AssertionDataTestMethod ]
346
350
[ AssertionCodeFix (
347
- oldAssertion : "actual.Intersect(expected).Should().BeEmpty({0});" ,
348
- newAssertion : "actual.Should().NotIntersectWith(expected{0});" ) ]
351
+ oldAssertion : "actual.Intersect(expected).Should().BeEmpty({0});" ,
352
+ newAssertion : "actual.Should().NotIntersectWith(expected{0});" ) ]
349
353
[ Implemented ]
350
354
public void CollectionShouldNotIntersectWith_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldNotIntersectWithCodeFix , CollectionShouldNotIntersectWithAnalyzer > ( oldAssertion , newAssertion ) ;
351
355
@@ -376,37 +380,41 @@ public class CollectionTests
376
380
377
381
[ AssertionDataTestMethod ]
378
382
[ AssertionDiagnostic ( "actual.Should().HaveSameCount(actual.Distinct(){0});" ) ]
379
- [ NotImplemented ]
383
+ [ Implemented ]
380
384
public void CollectionShouldOnlyHaveUniqueItems_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < CollectionShouldOnlyHaveUniqueItemsAnalyzer > ( assertion ) ;
381
385
382
386
[ AssertionDataTestMethod ]
383
387
[ AssertionCodeFix (
384
388
oldAssertion : "actual.Should().HaveSameCount(actual.Distinct(){0});" ,
385
389
newAssertion : "actual.Should().OnlyHaveUniqueItems({0});" ) ]
386
- [ NotImplemented ]
390
+ [ Implemented ]
387
391
public void CollectionShouldOnlyHaveUniqueItems_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldOnlyHaveUniqueItemsCodeFix , CollectionShouldOnlyHaveUniqueItemsAnalyzer > ( oldAssertion , newAssertion ) ;
388
392
389
393
[ AssertionDataTestMethod ]
390
394
[ AssertionDiagnostic ( "actual.Select(x => x.BooleanProperty).Should().OnlyHaveUniqueItems({0});" ) ]
391
- [ NotImplemented ]
395
+ [ Implemented ]
392
396
public void CollectionShouldOnlyHaveUniqueItemsByComparer_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < CollectionShouldOnlyHaveUniqueItemsByComparerAnalyzer > ( assertion ) ;
393
397
394
398
[ AssertionDataTestMethod ]
395
399
[ AssertionCodeFix (
396
400
oldAssertion : "actual.Select(x => x.BooleanProperty).Should().OnlyHaveUniqueItems({0});" ,
397
401
newAssertion : "actual.Should().OnlyHaveUniqueItems(x => x.BooleanProperty{0});" ) ]
398
- [ NotImplemented ]
402
+ [ Implemented ]
403
+ [ Ignore ( "Will be available in Fluent Assertions 5.0" ) ]
399
404
public void CollectionShouldOnlyHaveUniqueItemsByComparer_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldOnlyHaveUniqueItemsByComparerCodeFix , CollectionShouldOnlyHaveUniqueItemsByComparerAnalyzer > ( oldAssertion , newAssertion ) ;
405
+
400
406
[ AssertionDataTestMethod ]
401
407
[ AssertionDiagnostic ( "actual.FirstOrDefault().Should().BeNull({0});" ) ]
402
408
[ NotImplemented ]
409
+ [ Ignore ( "What Should Happen?" ) ]
403
410
public void CollectionShouldHaveElementAt0Null_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < CollectionShouldHaveElementAt0NullAnalyzer > ( assertion ) ;
404
411
405
412
[ AssertionDataTestMethod ]
406
413
[ AssertionCodeFix (
407
414
oldAssertion : "actual.FirstOrDefault().Should().BeNull({0});" ,
408
415
newAssertion : "actual.Should().HaveElementAt(0, null{0});" ) ]
409
416
[ NotImplemented ]
417
+ [ Ignore ( "What Should Happen?" ) ]
410
418
public void CollectionShouldHaveElementAt0Null_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldHaveElementAt0NullCodeFix , CollectionShouldHaveElementAt0NullAnalyzer > ( oldAssertion , newAssertion ) ;
411
419
412
420
private void VerifyCSharpDiagnostic < TDiagnosticAnalyzer > ( string sourceAssersion ) where TDiagnosticAnalyzer : Microsoft . CodeAnalysis . Diagnostics . DiagnosticAnalyzer , new ( )
0 commit comments