Skip to content

Commit

Permalink
Merge pull request #48101 from Youssef1313/patch-32
Browse files Browse the repository at this point in the history
Create RecordDeclarationOrganizer
  • Loading branch information
CyrusNajmabadi authored Jan 5, 2021
2 parents 7902b3b + 161a231 commit 6f35aa5
Show file tree
Hide file tree
Showing 4 changed files with 585 additions and 464 deletions.
70 changes: 40 additions & 30 deletions src/EditorFeatures/CSharpTest/Organizing/OrganizeModifiersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,67 +12,77 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Organizing
{
public class OrganizeModifiersTests : AbstractOrganizerTests
{
[Fact, Trait(Traits.Feature, Traits.Features.Organizing)]
public async Task TestTypes1()
[Theory, Trait(Traits.Feature, Traits.Features.Organizing)]
[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()
[Theory, Trait(Traits.Feature, Traits.Features.Organizing)]
[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()
[Theory, Trait(Traits.Feature, Traits.Features.Organizing)]
[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()
[Theory, Trait(Traits.Feature, Traits.Features.Organizing)]
[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()
[Theory, Trait(Traits.Feature, Traits.Features.Organizing)]
[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

0 comments on commit 6f35aa5

Please sign in to comment.