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
2 changes: 2 additions & 0 deletions src/FluentAssertions.Analyzers.Tests/DiagnosticVerifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ private static void VerifyFix(string language, DiagnosticAnalyzer analyzer, Code
}
}

codeFixProvider.FixableDiagnosticIds.Should().BeEquivalentTo(analyzer.SupportedDiagnostics.Select(d => d.Id));

//after applying all of the code fixes, compare the resulting string to the inputted one
var actual = GetStringFromDocument(document);
actual.Should().Be(newSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public AssertIsFalseSyntaxVisitor() : base(new MemberValidator("IsFalse"))
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(AssertIsFalseCodeFix)), Shared]
public class AssertIsFalseCodeFix : MsTestAssertCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(CollectionShouldBeEmptyAnalyzer.DiagnosticId);
public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(AssertIsFalseAnalyzer.DiagnosticId);

protected override ExpressionSyntax GetNewExpression(ExpressionSyntax expression, FluentAssertionsDiagnosticProperties properties)
=> RenameMethodAndReplaceWithSubjectShould(expression, "IsFalse", "BeFalse");
Expand Down
2 changes: 1 addition & 1 deletion src/FluentAssertions.Analyzers/Tips/MsTest/AssertIsTrue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public AssertIsTrueSyntaxVisitor() : base(new MemberValidator("IsTrue"))
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(AssertIsTrueCodeFix)), Shared]
public class AssertIsTrueCodeFix : MsTestAssertCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(CollectionShouldBeEmptyAnalyzer.DiagnosticId);
public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(AssertIsTrueAnalyzer.DiagnosticId);

protected override ExpressionSyntax GetNewExpression(ExpressionSyntax expression, FluentAssertionsDiagnosticProperties properties)
=> RenameMethodAndReplaceWithSubjectShould(expression, "IsTrue", "BeTrue");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public AssertObjectNotEqualSyntaxVisitor() : base(
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(AssertNotEqualCodeFix)), Shared]
public class AssertNotEqualCodeFix : XunitCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(AssertEqualAnalyzer.DiagnosticId);
public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(AssertNotEqualAnalyzer.DiagnosticId);

protected override ExpressionSyntax GetNewExpression(
ExpressionSyntax expression,
Expand Down