Skip to content

Commit f919693

Browse files
committed
bugfix: false positive on expressions containing Count
1 parent 731954c commit f919693

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/FluentAssertions.Analyzers.Tests/Tips/CollectionTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ public class CollectionTests
329329
[AssertionDiagnostic(@"var array = new string[1, 1]; array.Length.Should().Be(0{0});")]
330330
[AssertionDiagnostic(@"var array = new string[2, 2]; array.Length.Should().Be(0{0});")]
331331
[AssertionDiagnostic(@"var array = new string[3, 3, 3]; array.Length.Should().Be(0{0});")]
332+
[AssertionDiagnostic(@"int[] array1 = [1, 2, 3]; int[] array2 = [4, 5, 6]; var both = x.Concat(y).ToArray(); (array1.Length + array2.Length).Should().Be(both.Length{0});")]
332333
[Implemented(Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/309")]
333334
public void CollectionShouldHaveCount_LengthShouldBe_TestNoAnalyzer(string assertion) => DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(new StringBuilder()
334335
.AppendLine("using System;")

0 commit comments

Comments
 (0)