当前位置: 首页>>代码示例>>C#>>正文


C# RenameTrackingTestState.AssertNoTag方法代码示例

本文整理汇总了C#中Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState.AssertNoTag方法的典型用法代码示例。如果您正苦于以下问题:C# RenameTrackingTestState.AssertNoTag方法的具体用法?C# RenameTrackingTestState.AssertNoTag怎么用?C# RenameTrackingTestState.AssertNoTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState的用法示例。


在下文中一共展示了RenameTrackingTestState.AssertNoTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenameTrackingNotInBlankFile

 public async Task RenameTrackingNotInBlankFile()
 {
     var code = @"$$";
     using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
     {
         state.EditorOperations.InsertText("d");
         await state.AssertNoTag().ConfigureAwait(true);
     }
 }
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:9,代码来源:RenameTrackingTaggerProviderTests.cs

示例2: RenameTrackingNotInBlankFile

 public void RenameTrackingNotInBlankFile()
 {
     var code = @"$$";
     using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
     {
         state.EditorOperations.InsertText("d");
         state.AssertNoTag();
     }
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:9,代码来源:RenameTrackingTaggerProviderTests.cs

示例3: RenameTrackingNotOnCreation

        public async Task RenameTrackingNotOnCreation()
        {
            var code = @"
class C$$
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                await state.AssertNoTag().ConfigureAwait(true);
            }
        }
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:11,代码来源:RenameTrackingTaggerProviderTests.cs

示例4: RenameTrackingNotOnCreation

        public void RenameTrackingNotOnCreation()
        {
            var code = @"
class C$$
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.AssertNoTag();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:11,代码来源:RenameTrackingTaggerProviderTests.cs

示例5: RenameTrackingInvokeAndChangeBackToOriginal

        public void RenameTrackingInvokeAndChangeBackToOriginal()
        {
            var code = @"
class Cat$$
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("s");
                state.AssertTag("Cat", "Cats", invokeAction: true);

                state.AssertNoTag();

                state.EditorOperations.Backspace();
                state.AssertTag("Cats", "Cat");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:17,代码来源:RenameTrackingTaggerProviderTests.cs

示例6: RenameTrackingNotThroughEmptyStringResumeOnDifferentSpace

        public void RenameTrackingNotThroughEmptyStringResumeOnDifferentSpace()
        {
            var code = @"
class  C$$
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.Backspace();

                // Move to previous space
                state.MoveCaret(-1);

                state.EditorOperations.InsertText("D");
                state.AssertNoTag();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:17,代码来源:RenameTrackingTaggerProviderTests.cs

示例7: RenameTracking_NoTagWhenFirstEditChangesReferenceToAnotherSymbol

        public void RenameTracking_NoTagWhenFirstEditChangesReferenceToAnotherSymbol()
        {
            var code = @"
class C
{
    void M()
    {
        int abc = 7;
        int ab = 8;
        int z = abc$$;
    }
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.Backspace();
                state.AssertNoTag();
            }
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:18,代码来源:RenameTrackingTaggerProviderTests.cs

示例8: RenameTracking_Nameof_FromMethodGroupReference

        public void RenameTracking_Nameof_FromMethodGroupReference()
        {
            var code = @"
class C
{
    void M()
    {
        nameof(M$$).ToString();
    }

    void M(int x)
    {
    }
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("at");

                state.AssertTag("M", "Mat", invokeAction: true);

                // Make sure the rename completed            
                var expectedCode = @"
class C
{
    void Mat()
    {
        nameof(Mat).ToString();
    }

    void Mat(int x)
    {
    }
}";
                Assert.Equal(expectedCode, state.HostDocument.TextBuffer.CurrentSnapshot.GetText());
                state.AssertNoTag();
            }
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:37,代码来源:RenameTrackingTaggerProviderTests.cs

示例9: RenameTrackingNotWhenStartedFromTextualWordInTrivia

        public void RenameTrackingNotWhenStartedFromTextualWordInTrivia()
        {
            var code = @"
Module Program
    Sub Main()
        Dim [x$$ = 1
    End Sub
End Module";
            using (var state = new RenameTrackingTestState(code, LanguageNames.VisualBasic))
            {
                state.EditorOperations.InsertText("]");
                state.AssertNoTag();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:14,代码来源:RenameTrackingTaggerProviderTests.cs

示例10: RenameTrackingNotifiesThirdPartiesOfRenameOperation

        public void RenameTrackingNotifiesThirdPartiesOfRenameOperation()
        {
            var code = @"
class Cat$$
{
    public Cat()
    {
    }
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("s");
                state.AssertTag("Cat", "Cats", invokeAction: true);
                Assert.Equal(1, state.RefactorNotifyService.OnBeforeSymbolRenamedCount);
                Assert.Equal(1, state.RefactorNotifyService.OnAfterSymbolRenamedCount);

                var expectedCode = @"
class Cats
{
    public Cats()
    {
    }
}";
                Assert.Equal(expectedCode, state.HostDocument.TextBuffer.CurrentSnapshot.GetText());

                state.AssertNoNotificationMessage();
                state.AssertNoTag();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:29,代码来源:RenameTrackingTaggerProviderTests.cs

示例11: RenameTrackingRedoAlwaysClearsState

        public void RenameTrackingRedoAlwaysClearsState()
        {
            var code = @"
class Cat$$
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("s");
                state.AssertTag("Cat", "Cats", invokeAction: true);

                state.AssertNoTag();

                // Resume rename tracking session
                state.Undo(2);
                state.AssertTag("Cat", "Cats");

                state.Redo();
                state.AssertNoTag();

                state.Redo();
                state.AssertNoTag();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:24,代码来源:RenameTrackingTaggerProviderTests.cs

示例12: RenameTrackingNotOnSquareBracketsInCSharp

        public void RenameTrackingNotOnSquareBracketsInCSharp()
        {
            var code = @"
class $$C
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("[");
                state.AssertNoTag();

                state.MoveCaret(1);
                state.EditorOperations.InsertText("]");
                state.AssertNoTag();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:16,代码来源:RenameTrackingTaggerProviderTests.cs

示例13: RenameTrackingHandlesSquareBracketsAsVisualBasicEscape

        public void RenameTrackingHandlesSquareBracketsAsVisualBasicEscape()
        {
            var code = @"
Class $$C
End Class";
            using (var state = new RenameTrackingTestState(code, LanguageNames.VisualBasic))
            {
                state.EditorOperations.InsertText("[");
                state.AssertNoTag();

                state.MoveCaret(1);
                state.EditorOperations.InsertText("]");
                state.AssertTag("C", "[C]");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:15,代码来源:RenameTrackingTaggerProviderTests.cs

示例14: RenameTrackingNotInString

        public void RenameTrackingNotInString()
        {
            var code = @"
class C
{
    void Foo()
    {
        string s = ""abc$$""
    }
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("d");
                state.AssertNoTag();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:16,代码来源:RenameTrackingTaggerProviderTests.cs

示例15: RenameTrackingNotAtMethodArgument

        public void RenameTrackingNotAtMethodArgument()
        {
            var code = @"
class ABCD
{
    void Foo(int x)
    {
        int abc = 3;
        Foo($$
    }
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("a");
                state.AssertNoTag();

                state.EditorOperations.InsertText("b");
                state.AssertNoTag();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:20,代码来源:RenameTrackingTaggerProviderTests.cs


注:本文中的Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking.RenameTrackingTestState.AssertNoTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。