Skip to content

Test fix all providers #352

@giggio

Description

@giggio

This issue is an umbrella issue. We will only close it when every code fix provider has tests on their fix all actions.

There are several code fix providers to test. If you want to work on one of them just comment on this issue.

Most code fix providers are not having their fix all actions tested. Also, most of them use the BatchFixer. We need to write tests to these code fix providers.

Bellow is an example of a Code Fix provider test from RemoveUnreachableCodeTest:

 [Fact]
        public async void FixAllProjectUnreacheableCode()
        {
            const string source1 = @"
class Foo
{
    void Method()
    {
        return;
        var a = 1;
        var b = 1;
    }
}";
            const string source2 = @"
class Foo2
{
    void Method()
    {
        return;
        var a = 1;
        var b = 1;
    }
}";
            const string fixtest1 = @"
class Foo
{
    void Method()
    {
        return;
    }
}";
            const string fixtest2 = @"
class Foo2
{
    void Method()
    {
        return;
    }
}";
            await VerifyCSharpFixAllAsync(new[] { source1, source2 }, new[] { fixtest1, fixtest2 });

Bellow are the code fix provider that need fixing when this issue was opened. They are ordered by code coverage, so working on the top ones is better.

  • InterfaceNameCodeFixProvider (VB)
  • SealedAttributeCodeFixProvider (VB)
  • StaticConstructorExceptionCodeFixProvider (VB)
  • UseConfigureAwaitFalseCodeFixProvider (VB)
  • DisposablesShouldCallSuppressFinalizeCodeFixProvider (VB)
  • TernaryOperatorCodeFixProviders (VB)
  • RemovePrivateMethodNeverUsedCodeFixProvider (VB)
  • CatchEmptyCodeFixProvider (VB)
  • InterfaceNameCodeFixProvider (C#)
  • MustInheritClassShouldNotHavePublicConstructorsCodeFixProvider (VB)
  • MakeLocalVariableConstWhenPossibleCodeFixProvider (VB)
  • UnusedParametersCodeFixProvider (VB)
  • RemoveWhereWhenItIsPossibleCodeFixProvider (VB)
  • ComputeExpressionCodeFixProvider (C#)
  • ArgumentExceptionCodeFixProvider (C#)
  • EmptyCatchBlockCodeFixProvider (VB)
  • UnnecessaryParenthesisCodeFixProvider (C#)
  • UnusedParametersCodeFixProvider (C#)
  • SealedAttributeCodeFixProvider (C#)
  • EmptyFinalizerCodeFixProvider (C#)
  • StaticConstructorExceptionCodeFixProvider (C#)
  • DisposablesShouldCallSuppressFinalizeCodeFixProvider (C#)
  • ConvertToSwitchCodeFixProvider (C#)
  • RemoveUnusedVariablesCodeFixProvider (C#)
  • RemovePrivateMethodNeverUsedCodeFixProvider (C#)
  • ConvertLambdaExpressionToMethodGroupFixProvider (C#)
  • EmptyObjectInitializerCodeFixProvider (C#)
  • UseInvokeMethodToFireEventCodeFixProvider (C#)
  • UseConfigureAwaitFalseCodeFixProvider (C#)
  • StringBuilderInLoopCodeFixProvider (VB - Has no fix all provider, must test that)
  • CatchEmptyCodeFixProvider (C#)
  • AlwaysUseVarCodeFixProvider (C#)
  • TaskNameAsyncCodeFixProvider (C#)
  • AbstractClassShouldNotHavePublicCtorsCodeFixProvider (C#)
  • RemoveAsyncFromMethodCodeFixProvider (C#)
  • RemoveWhereWhenItIsPossibleCodeFixProvider (C#)
  • TernaryOperatorCodeFixProvider (C#)
  • MergeNestedIfCodeFixProvider (C#)
  • CallExtensionMethodAsExtensionCodeFixProvider (C#)
  • ParameterRefactoryCodeFixProvider (VB)
  • IfReturnTrueCodeFixProvider (C#)
  • StringRepresentationCodeFixProvider (C#)
  • PropertyPrivateSetCodeFixProvider (C#)
  • CopyEventToVariableBeforeFireCodeFixProvider (C#)
  • RemoveCommentedCodeCodeFixProvider (C#)
  • ArgumentExceptionCodeFixProvider (C#)
  • ReadonlyFieldCodeFixProvider (C#)
  • SimplifyRedundantBooleanComparisonsCodeFixProvider (C#)
  • RethrowExceptionCodeFixProvider (C#)
  • AddBracesToSwitchSectionsCodeFixProvider (C#)
  • StringFormatCodeFixProvider (C#)
  • MakeLocalVariableConstWhenItIsPossibleCodeFixProvider (C#)
  • ForInArrayCodeFixProvider (C#)
  • RemoveTrailingWhitespaceCodeFixProvider (C#)
  • ExistenceOperatorCodeFixProvider (C#)
  • EmptyCatchBlockCodeFixProvider (C#)
  • StringBuilderInLoopCodeFixProvider (C# - Has no fix all provider, must test that)
  • ConvertToExpressionBodiedMemberCodeFixProvider (C#)
  • NumericLiteralCodeFixProvider (C#)
  • UseStaticRegexIsMatchCodeFixProvider (C#)
  • DisposableFieldNotDisposedCodeFixProvider (C#)
  • InvertForCodeFixProvider (C#)
  • ObjectInitializerCodeFixProvider (C#)
  • ParameterRefactoryCodeFixProvider (C#)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions