提交 a2b787e3 编写于 作者: J Jonathon Marolf 提交者: GitHub

Merge pull request #17551 from jmarolf/test-move/BasicClassification

Porting VB Classification Tests
......@@ -139,7 +139,7 @@ public BasicAddMissingReference(VisualStudioInstanceFactory instanceFactory)
}
[Fact, Trait(Traits.Feature, Traits.Features.AddMissingReference)]
public void Verify_Available_Code_Actions()
public void VerifyAvailableCodeActions()
{
OpenFile(ConsoleProjectName, "Module1.vb");
PlaceCaret("y.foo", charsOffset: 1);
......@@ -157,7 +157,7 @@ public void Verify_Available_Code_Actions()
}
[Fact, Trait(Traits.Feature, Traits.Features.AddMissingReference)]
public void Invoke_Some_Fixes_In_VisualBasic_Then_Verify_References()
public void InvokeSomeFixesInVisualBasicThenVerifyReferences()
{
OpenFile(ConsoleProjectName, "Module1.vb");
PlaceCaret("y.foo", charsOffset: 1);
......
// 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.CodeAnalysis.Test.Utilities;
using Microsoft.VisualStudio.IntegrationTest.Utilities;
using Xunit;
namespace Roslyn.VisualStudio.IntegrationTests.VisualBasic
{
[Collection(nameof(SharedIntegrationHostFixture))]
public class BasicClassification : AbstractEditorTest
{
protected override string LanguageName => LanguageNames.VisualBasic;
public BasicClassification(VisualStudioInstanceFactory instanceFactory)
: base(instanceFactory, nameof(BasicClassification))
{
}
[Fact, Trait(Traits.Feature, Traits.Features.Classification)]
public void Verify_Color_Of_Some_Tokens()
{
Editor.SetText(@"Imports System
Imports MathAlias = System.Math
Namespace Acme
''' <summary>innertext
''' </summary>
''' <!--comment-->
''' <![CDATA[cdata]]>
''' <typeparam name=""attribute"" />
Public Class Program
Public Shared Sub Main(args As String())
Console.WriteLine(""Hello World"") 'comment
End Sub
End Class
End Namespace");
PlaceCaret("MathAlias");
VerifyCurrentTokenType(tokenType: "identifier");
PlaceCaret("Namespace");
VerifyCurrentTokenType(tokenType: "keyword");
PlaceCaret("summary");
VerifyCurrentTokenType(tokenType: "xml doc comment - name");
PlaceCaret("innertext");
VerifyCurrentTokenType(tokenType: "xml doc comment - text");
PlaceCaret("!--");
VerifyCurrentTokenType(tokenType: "xml doc comment - delimiter");
PlaceCaret("comment");
VerifyCurrentTokenType(tokenType: "xml doc comment - comment");
PlaceCaret("CDATA");
VerifyCurrentTokenType(tokenType: "xml doc comment - delimiter");
PlaceCaret("cdata");
VerifyCurrentTokenType(tokenType: "xml doc comment - cdata section");
PlaceCaret("attribute");
VerifyCurrentTokenType(tokenType: "identifier");
PlaceCaret("Class");
VerifyCurrentTokenType(tokenType: "keyword");
PlaceCaret("Program");
VerifyCurrentTokenType(tokenType: "class name");
PlaceCaret("Hello");
VerifyCurrentTokenType(tokenType: "string");
PlaceCaret("comment");
VerifyCurrentTokenType(tokenType: "comment");
}
[Fact, Trait(Traits.Feature, Traits.Features.Classification)]
public void Semantic_Classification()
{
Editor.SetText(@"
Imports System
Class Foo
Inherits Attribute
End Class");
PlaceCaret("Foo");
VerifyCurrentTokenType(tokenType: "class name");
PlaceCaret("Attribute");
VerifyCurrentTokenType(tokenType: "class name");
}
}
}
......@@ -39,6 +39,7 @@
<Compile Include="VisualBasic\BasicAddMissingReference.cs" />
<Compile Include="VisualBasic\BasicAutomaticBraceCompletion.cs" />
<Compile Include="VisualBasic\BasicBuild.cs" />
<Compile Include="VisualBasic\BasicClassification.cs" />
<Compile Include="VisualBasic\BasicGenerateEqualsAndGetHashCodeDialog.cs" />
<Compile Include="VisualBasic\BasicGenerateConstructorDialog.cs" />
<Compile Include="VisualBasic\BasicChangeSignatureDialog.cs" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册