@@ -309,6 +309,12 @@ public class CollectionTests
309309 [ Implemented ]
310310 public void CollectionShouldHaveCount_CountShouldBe0_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnosticCodeBlock ( assertion , DiagnosticMetadata . CollectionShouldBeEmpty_CountShouldBe0 ) ;
311311
312+ [ TestMethod ]
313+ [ AssertionDiagnostic ( "actual.Length.Should().Be(0{0});" ) ]
314+ [ AssertionDiagnostic ( "actual.ToArray().Length.Should().Be(0{0}).And.ToString();" ) ]
315+ [ Implemented ]
316+ public void CollectionShouldHaveCount_LengthShouldBe0_TestAnalyzer ( string assertion ) => VerifyArrayCSharpDiagnosticCodeBlock ( assertion , DiagnosticMetadata . CollectionShouldBeEmpty_LengthShouldBe0 ) ;
317+
312318 [ TestMethod ]
313319 [ AssertionDiagnostic ( "actual.Count().Should().Be(1{0});" ) ]
314320 [ AssertionDiagnostic ( "actual.AsEnumerable().Count().Should().Be(1{0}).And.ToString();" ) ]
@@ -317,6 +323,12 @@ public class CollectionTests
317323 [ Implemented ]
318324 public void CollectionShouldHaveCount_CountShouldBe1_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnosticCodeBlock ( assertion , DiagnosticMetadata . CollectionShouldContainSingle_CountShouldBe1 ) ;
319325
326+ [ TestMethod ]
327+ [ AssertionDiagnostic ( "actual.Length.Should().Be(1{0});" ) ]
328+ [ AssertionDiagnostic ( "actual.ToArray().Length.Should().Be(1{0}).And.ToString();" ) ]
329+ [ Implemented ]
330+ public void CollectionShouldHaveCount_ArrayLengthShouldBe1_TestAnalyzer ( string assertion ) => VerifyArrayCSharpDiagnosticCodeBlock ( assertion , DiagnosticMetadata . CollectionShouldContainSingle_LengthShouldBe1 ) ;
331+
320332 [ TestMethod ]
321333 [ AssertionDiagnostic ( "(array.Count() + 1).Should().Be(0{0}).And.ToString();" ) ]
322334 [ AssertionDiagnostic ( "(array.Count() + 1).Should().Be(1{0}).And.ToString();" ) ]
@@ -394,9 +406,15 @@ public void CollectionShouldHaveCount_LengthShouldBe_TestNoAnalyzer(string asser
394406 [ AssertionCodeFix (
395407 oldAssertion : "actual.ToList().Count.Should().Be(0{0});" ,
396408 newAssertion : "actual.ToList().Should().BeEmpty({0});" ) ]
409+ [ AssertionCodeFix (
410+ oldAssertion : "actual.ToArray().Length.Should().Be(0{0});" ,
411+ newAssertion : "actual.ToArray().Should().BeEmpty({0});" ) ]
397412 [ AssertionCodeFix (
398413 oldAssertion : "actual.ToList().Count.Should().Be(1{0});" ,
399414 newAssertion : "actual.ToList().Should().ContainSingle({0});" ) ]
415+ [ AssertionCodeFix (
416+ oldAssertion : "actual.ToArray().Length.Should().Be(1{0});" ,
417+ newAssertion : "actual.ToArray().Should().ContainSingle({0});" ) ]
400418 [ AssertionCodeFix (
401419 oldAssertion : "actual.ToList().Count.Should().Be(6{0});" ,
402420 newAssertion : "actual.ToList().Should().HaveCount(6{0});" ) ]
0 commit comments