Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (48 sloc) 1.34 KB
// Copyright (c) Josef Pihrt. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Diagnostics;
using Roslynator.CSharp.CodeFixes;
using Xunit;
namespace Roslynator.CSharp.Analysis.Tests
{
public class RCS1081SplitVariableDeclarationTests : AbstractCSharpFixVerifier
{
public override DiagnosticDescriptor Descriptor { get; } = DiagnosticDescriptors.SplitVariableDeclaration;
public override DiagnosticAnalyzer Analyzer { get; } = new SplitVariableDeclarationAnalyzer();
public override CodeFixProvider FixProvider { get; } = new VariableDeclarationCodeFixProvider();
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SplitVariableDeclaration)]
public async Task Test_SwitchSection()
{
await VerifyDiagnosticAndFixAsync(@"
class C
{
void M()
{
switch ("""")
{
case """":
[|object x1, x2|];
break;
}
}
}
", @"
class C
{
void M()
{
switch ("""")
{
case """":
object x1;
object x2;
break;
}
}
}
");
}
}
}
You can’t perform that action at this time.