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
4 changes: 2 additions & 2 deletions src/FluentAssertions.Analyzers.Tests/Tips/NumericTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public class NumericTests
[AssertionCodeFix(
oldAssertion: "actual.Should().BeLessOrEqualTo(upper).And.BeGreaterOrEqualTo(lower{0});",
newAssertion: "actual.Should().BeInRange(lower, upper{0});")]
[NotImplemented]
public void NumericShouldBeInRange_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFix<NumericShouldBeApproximatelyCodeFix, NumericShouldBeInRangeAnalyzer>(oldAssertion, newAssertion);
[Implemented]
public void NumericShouldBeInRange_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFix<NumericShouldBeInRangeCodeFix, NumericShouldBeInRangeAnalyzer>(oldAssertion, newAssertion);

[DataTestMethod]
[AssertionDiagnostic("Math.Abs(expected - actual).Should().BeLessOrEqualTo(delta{0});")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ protected override ExpressionSyntax GetNewExpression(ExpressionSyntax expression
if (properties.VisitorName == nameof(NumericShouldBeInRangeAnalyzer.BeGreaterOrEqualToAndBeLessOrEqualToSyntaxVisitor))
{
var removeLess = NodeReplacement.RemoveAndExtractArguments("BeLessOrEqualTo");
var newExpression = GetNewExpression(expression, removeLess);

var newExpression = GetNewExpression(expression, NodeReplacement.RemoveMethodBefore("BeLessOrEqualTo"), removeLess);
var renameGreater = NodeReplacement.RenameAndExtractArguments("BeGreaterOrEqualTo", "BeInRange");
newExpression = GetNewExpression(newExpression, renameGreater);

Expand All @@ -78,7 +78,7 @@ protected override ExpressionSyntax GetNewExpression(ExpressionSyntax expression
else if (properties.VisitorName == nameof(NumericShouldBeInRangeAnalyzer.BeLessOrEqualToAndBeGreaterOrEqualToSyntaxVisitor))
{
var removeGreater = NodeReplacement.RemoveAndExtractArguments("BeGreaterOrEqualTo");
var newExpression = GetNewExpression(expression, removeGreater);
var newExpression = GetNewExpression(expression, NodeReplacement.RemoveMethodBefore("BeGreaterOrEqualTo"), removeGreater);

var renameLess = NodeReplacement.RenameAndExtractArguments("BeLessOrEqualTo", "BeInRange");
newExpression = GetNewExpression(newExpression, renameLess);
Expand Down