Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create RecordDeclarationOrganizer #48101

Merged
merged 11 commits into from
Jan 5, 2021
60 changes: 35 additions & 25 deletions src/EditorFeatures/CSharpTest/Organizing/OrganizeModifiersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,76 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Organizing
public class OrganizeModifiersTests : AbstractOrganizerTests
{
[Fact, Trait(Traits.Feature, Traits.Features.Organizing)]
public async Task TestTypes1()
[InlineData("class")]
[InlineData("record")]
public async Task TestTypes1(string typeKind)
{
var initial =
@"static public class C {
}";
$@"static public {typeKind} C {{
}}";
var final =
@"public static class C {
}";
$@"public static {typeKind} C {{
}}";

await CheckAsync(initial, final);
}

[Fact, Trait(Traits.Feature, Traits.Features.Organizing)]
public async Task TestTypes2()
[InlineData("class")]
[InlineData("record")]
public async Task TestTypes2(string typeKind)
{
var initial =
@"public static class D {
}";
$@"public static {typeKind} D {{
}}";
var final =
@"public static class D {
}";
$@"public static {typeKind} D {{
}}";

await CheckAsync(initial, final);
}

[Fact, Trait(Traits.Feature, Traits.Features.Organizing)]
public async Task TestTypes3()
[InlineData("class")]
[InlineData("record")]
public async Task TestTypes3(string typeKind)
{
var initial =
@"public static partial class E {
}";
$@"public static partial {typeKind} E {{
}}";
var final =
@"public static partial class E {
}";
$@"public static partial {typeKind} E {{
}}";

await CheckAsync(initial, final);
}

[Fact, Trait(Traits.Feature, Traits.Features.Organizing)]
public async Task TestTypes4()
[InlineData("class")]
[InlineData("record")]
public async Task TestTypes4(string typeKind)
{
var initial =
@"static public partial class F {
}";
$@"static public partial {typeKind} F {{
}}";
var final =
@"public static partial class F {
}";
$@"public static partial {typeKind} F {{
}}";

await CheckAsync(initial, final);
}

[Fact, Trait(Traits.Feature, Traits.Features.Organizing)]
public async Task TestTypes5()
[InlineData("class")]
[InlineData("record")]
public async Task TestTypes5(string typeKind)
{
var initial =
@"unsafe public static class F {
}";
$@"unsafe public static {typeKind} F {{
}}";
var final =
@"public static unsafe class F {
}";
$@"public static unsafe {typeKind} F {{
}}";

await CheckAsync(initial, final);
}
Expand Down
Loading