Skip to content

Commit 5049148

Browse files
committed
bugfix: false positive on expressions containing Count
1 parent 8b07915 commit 5049148

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ private static void AnalyzeInvocation(OperationAnalysisContext context, FluentAs
334334

335335
}
336336
}
337-
if (invocation.TryGetFirstDescendent<IPropertyReferenceOperation>(out var propertyBeforeShould))
337+
var argument = invocation.Arguments[0].Value.UnwrapConversion();
338+
if (argument is IPropertyReferenceOperation propertyBeforeShould)
338339
{
339340
switch (propertyBeforeShould.Property.Name)
340341
{

0 commit comments

Comments
 (0)