diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpOrganizing.cs b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpOrganizing.cs new file mode 100644 index 0000000000000..97ed5800ab5c0 --- /dev/null +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpOrganizing.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Microsoft.CodeAnalysis; +using Microsoft.VisualStudio.IntegrationTest.Utilities; +using Roslyn.Test.Utilities; +using Xunit; + +namespace Roslyn.VisualStudio.IntegrationTests.CSharp +{ + [Collection(nameof(SharedIntegrationHostFixture))] + public class CSharpOrganizing : AbstractEditorTest + { + protected override string LanguageName => LanguageNames.CSharp; + + public CSharpOrganizing(VisualStudioInstanceFactory instanceFactory) + : base(instanceFactory, nameof(CSharpOrganizing)) + { + } + + [Fact, Trait(Traits.Feature, Traits.Features.Organizing)] + public void RemoveAndSort() + { + SetUpEditor(@"$$ +using C; +using B; +using A; + +class Test +{ + CA a = null; + CC c = null; +} +namespace A { public class CA { } } +namespace B { public class CB { } } +namespace C { public class CC { } }"); + VisualStudio.ExecuteCommand("Edit.RemoveAndSort"); + VisualStudio.Editor.Verify.TextContains(@" +using A; +using C; + +class Test +{ + CA a = null; + CC c = null; +} +namespace A { public class CA { } } +namespace B { public class CB { } } +namespace C { public class CC { } }"); + + } + } +} \ No newline at end of file diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicOrganizing.cs b/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicOrganizing.cs new file mode 100644 index 0000000000000..f05c951c9aab6 --- /dev/null +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicOrganizing.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Microsoft.CodeAnalysis; +using Microsoft.VisualStudio.IntegrationTest.Utilities; +using Roslyn.Test.Utilities; +using Xunit; + +namespace Roslyn.VisualStudio.IntegrationTests.Basic +{ + [Collection(nameof(SharedIntegrationHostFixture))] + public class BasicOrganizing : AbstractEditorTest + { + protected override string LanguageName => LanguageNames.VisualBasic; + + public BasicOrganizing(VisualStudioInstanceFactory instanceFactory) + : base(instanceFactory, nameof(BasicOrganizing)) + { + } + + [Fact, Trait(Traits.Feature, Traits.Features.Organizing)] + public void RemoveAndSort() + { + SetUpEditor(@"Imports System.Linq$$ +Imports System +Imports System.Runtime.InteropServices +Imports System.Runtime.CompilerServices +Class Test + Sub Method( Optional str As String = Nothing) + Dim data As COMException + End Sub +End Class"); + VisualStudio.ExecuteCommand("Edit.RemoveAndSort"); + VisualStudio.Editor.Verify.TextContains(@"Imports System.Runtime.CompilerServices +Imports System.Runtime.InteropServices +Class Test + Sub Method( Optional str As String = Nothing) + Dim data As COMException + End Sub +End Class"); + + } + } +} \ No newline at end of file diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/VisualStudioIntegrationTests.csproj b/src/VisualStudio/IntegrationTest/IntegrationTests/VisualStudioIntegrationTests.csproj index 2d4d19c6c0b5a..fda1bc37d85eb 100644 --- a/src/VisualStudio/IntegrationTest/IntegrationTests/VisualStudioIntegrationTests.csproj +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/VisualStudioIntegrationTests.csproj @@ -39,6 +39,7 @@ + @@ -65,6 +66,7 @@ +