@@ -320,6 +320,13 @@ public class CollectionTests
320320 [ Implemented ]
321321 public void CollectionShouldHaveCount_LengthShouldBe_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnosticCodeBlock ( assertion , DiagnosticMetadata . CollectionShouldHaveCount_LengthShouldBe ) ;
322322
323+ [ DataTestMethod ]
324+ [ AssertionDiagnostic ( "actual.Should().HaveCount(expected.Count() + 1{0});" ) ]
325+ [ AssertionDiagnostic ( "actual.Should().HaveCount(expected.Count() + unexpected.Count(){0});" ) ]
326+ [ AssertionDiagnostic ( "actual.Should().HaveCount(expected.Count + unexpected.Count{0});" ) ]
327+ [ Implemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/300" ) ]
328+ public void CollectionShouldHaveCount_TestNoAnalyzer ( string assertion ) => DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( GenerateCode . GenericIListCodeBlockAssertion ( assertion ) ) ;
329+
323330 [ DataTestMethod ]
324331 [ AssertionCodeFix (
325332 oldAssertion : "actual.Count().Should().Be(k{0});" ,
@@ -533,6 +540,13 @@ public class CollectionTests
533540 [ Implemented ]
534541 public void CollectionShouldHaveSameCount_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnosticCodeBlock ( assertion , DiagnosticMetadata . CollectionShouldHaveSameCount_ShouldHaveCountOtherCollectionCount ) ;
535542
543+ [ DataTestMethod ]
544+ [ AssertionDiagnostic ( "actual.Should().HaveCount(expected.Count() + 1{0});" ) ]
545+ [ AssertionDiagnostic ( "actual.Should().HaveCount(expected.Count() + unexpected.Count(){0});" ) ]
546+ [ AssertionDiagnostic ( "actual.Should().HaveCount(1 + expected.Count(){0});" ) ]
547+ [ Implemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/300" ) ]
548+ public void CollectionShouldHaveSameCount_TestNoAnalyzer ( string assertion ) => DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( GenerateCode . GenericIListCodeBlockAssertion ( assertion ) ) ;
549+
536550 [ DataTestMethod ]
537551 [ AssertionCodeFix (
538552 oldAssertion : "actual.Should().HaveCount(expected.Count(){0});" ,
@@ -903,6 +917,11 @@ public void CollectionShouldContainSingle_TestAnalyzer_GenericIEnumerableShouldR
903917 [ Implemented ]
904918 public void CollectionShouldOnlyHaveUniqueItems_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnosticCodeBlock ( assertion , DiagnosticMetadata . CollectionShouldOnlyHaveUniqueItems_ShouldHaveSameCountThisCollectionDistinct ) ;
905919
920+ [ DataTestMethod ]
921+ [ AssertionDiagnostic ( "actual.Should().HaveSameCount(expected.Distinct(){0});" ) ]
922+ [ Implemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/299" ) ]
923+ public void CollectionShouldOnlyHaveUniqueItems_TestNoAnalyzer ( string assertion ) => DiagnosticVerifier . VerifyCSharpDiagnosticUsingAllAnalyzers ( GenerateCode . GenericIListCodeBlockAssertion ( assertion ) ) ;
924+
906925 [ DataTestMethod ]
907926 [ AssertionCodeFix (
908927 oldAssertion : "actual.Should().HaveSameCount(actual.Distinct(){0});" ,
@@ -1032,7 +1051,7 @@ private void VerifyCSharpFixExpressionBody(string oldSourceAssertion, string new
10321051 {
10331052 var oldSource = GenerateCode . GenericIListExpressionBodyAssertion ( oldSourceAssertion ) ;
10341053 var newSource = GenerateCode . GenericIListExpressionBodyAssertion ( newSourceAssertion ) ;
1035-
1054+
10361055 VerifyFix ( oldSource , newSource ) ;
10371056 }
10381057
0 commit comments