Skip to content

Commit

Permalink
VSI test for Edit.RemoveAndSort (#18503)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravi Chande authored Apr 6, 2017
1 parent 82110f4 commit 232d6f0
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
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 @@ -40,6 +40,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 Down Expand Up @@ -67,6 +68,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

0 comments on commit 232d6f0

Please sign in to comment.