Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/FluentAssertions.Analyzers.Tests/Tips/CollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ public void CollectionShouldHaveCount_LengthShouldBe_TestNoAnalyzer(string asser
[Implemented]
public void CollectionShouldHaveCountGreaterThan_TestAnalyzer(string assertion) => VerifyCSharpDiagnosticCodeBlock(assertion, DiagnosticMetadata.CollectionShouldHaveCountGreaterThan_CountShouldBeGreaterThan);

[DataTestMethod]
[AssertionDiagnostic("(actual.Count() + 1).Should().BeGreaterThan(k{0});")]
[AssertionDiagnostic("(actual.Count() + 1).Should().BeGreaterThan(6{0});")]
[Implemented]
public void CollectionShouldHaveCountGreaterThan_TestNoAnalyzer(string assertion) => DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(GenerateCode.GenericIListCodeBlockAssertion(assertion));

[DataTestMethod]
[AssertionCodeFix(
oldAssertion: "actual.Count().Should().BeGreaterThan(k{0});",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ private static void AnalyzeInvocation(OperationAnalysisContext context, FluentAs
return;
case "BeGreaterThan" when assertion.IsContainedInType(metadata.NumericAssertionsOfT2):
{
if (invocation.TryGetFirstDescendent<IInvocationOperation>(out var invocationBeforeShould))
if (invocation.TryGetSingleArgumentAs<IInvocationOperation>(out var invocationBeforeShould))
{
switch (invocationBeforeShould.TargetMethod.Name)
{
Expand Down
Loading