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

VSI test for Edit.RemoveAndSort #18503

Merged
merged 3 commits into from
Apr 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 { } }");

}
}
}
Original file line number Diff line number Diff line change
@@ -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(<CallerMemberName> 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(<CallerMemberName> Optional str As String = Nothing)
Dim data As COMException
End Sub
End Class");

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<Compile Include="CSharp\CSharpInteractive.cs" />
<Compile Include="AbstractEditorTest.cs" />
<Compile Include="CSharp\CSharpInteractiveCommands.cs" />
<Compile Include="CSharp\CSharpOrganizing.cs" />
<Compile Include="CSharp\CSharpNavigationBar.cs" />
<Compile Include="CSharp\CSharpKeywordHighlighting.cs" />
<Compile Include="CSharp\CSharpReplClassification.cs" />
Expand All @@ -65,6 +66,7 @@
<Compile Include="VisualBasic\BasicErrorListCommon.cs" />
<Compile Include="VisualBasic\BasicErrorListDesktop.cs" />
<Compile Include="VisualBasic\BasicErrorListNetCore.cs" />
<Compile Include="VisualBasic\BasicOrganizing.cs" />
<Compile Include="Workspace\WorkspaceBase.cs" />
<Compile Include="Workspace\WorkspacesDesktop.cs" />
<Compile Include="Workspace\WorkspacesNetCore.cs" />
Expand Down