Skip to content

Commit 55c5ee8

Browse files
committed
fixed #11
1 parent 3e79299 commit 55c5ee8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ namespace FluentAssertions.Analyzers.Tests.Tips
55
[TestClass]
66
public class SanityTests
77
{
8+
[TestMethod]
9+
[Implemented(Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/11")]
10+
public void CountWithPredicate()
11+
{
12+
const string assertion = "actual.Count(d => d.Message.Contains(\"a\")).Should().Be(2);";
13+
var source = GenerateCode.EnumerableCodeBlockAssertion(assertion);
14+
15+
DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source);
16+
}
17+
818
[TestMethod]
919
[Implemented(Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/10")]
1020
public void AssertionCallMultipleMethodWithTheSameNameAndArguments()

src/FluentAssertions.Analyzers/Tips/Collections/CollectionShouldHaveCount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected override IEnumerable<FluentAssertionsCSharpSyntaxVisitor> Visitors
2727

2828
private class CountShouldBeSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
2929
{
30-
public CountShouldBeSyntaxVisitor() : base(new MemberValidator("Count"), MemberValidator.Should, new MemberValidator("Be"))
30+
public CountShouldBeSyntaxVisitor() : base(MemberValidator.MathodNotContainingLambda("Count"), MemberValidator.Should, new MemberValidator("Be"))
3131
{
3232
}
3333
}

0 commit comments

Comments
 (0)