Skip to content

Commit 3974955

Browse files
authored
Merge pull request #4 from jnyrup/OnlyHaveUniqueItems
Codefix for CollectionShouldOnlyHaveUniqueItemsByComparer
2 parents 4b678fc + cd0bc52 commit 3974955

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FluentAssertions.BestPractices/Tips/Collections/CollectionShouldOnlyHaveUniqueItemsByComparer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ public class CollectionShouldOnlyHaveUniqueItemsByComparerCodeFix : FluentAssert
4242
public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(CollectionShouldOnlyHaveUniqueItemsByComparerAnalyzer.DiagnosticId);
4343

4444
protected override StatementSyntax GetNewStatement(FluentAssertionsDiagnosticProperties properties)
45-
=> SyntaxFactory.ParseStatement($"{properties}.Should().OnlyHaveUniqueItems({properties.CombineWithBecauseArgumentsString(properties.LambdaString)})");
45+
=> SyntaxFactory.ParseStatement($"{properties.VariableName}.Should().OnlyHaveUniqueItems({properties.CombineWithBecauseArgumentsString(properties.LambdaString)});");
4646
}
4747
}

0 commit comments

Comments
 (0)