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


C# RenameTrackingTestState.AssertTag方法代码示例

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


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

示例1: RenameTrackingTypingInMiddle

        public void RenameTrackingTypingInMiddle()
        {
            var code = @"
class AB$$CD
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("ZZ");
                state.AssertTag("ABCD", "ABZZCD");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:12,代码来源:RenameTrackingTaggerProviderTests.cs

示例2: RenameTrackingTypingAtBeginning

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

示例3: RenameTrackingTypingInMiddle

        public async Task RenameTrackingTypingInMiddle()
        {
            var code = @"
class AB$$CD
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("ZZ");
                await state.AssertTag("ABCD", "ABZZCD").ConfigureAwait(true);
            }
        }
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:12,代码来源:RenameTrackingTaggerProviderTests.cs

示例4: RenameTrackingTypingAtBeginning

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

示例5: RenameTrackingTypingAtEnd

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

示例6: RenameTrackingUndoTwiceRedoTwiceUndoStillWorks

        public void RenameTrackingUndoTwiceRedoTwiceUndoStillWorks()
        {
            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(2);
                state.AssertNoTag();

                // Back to original
                state.Undo();
                state.AssertNoTag();

                // Resume rename tracking session
                state.Undo();
                state.AssertTag("Cat", "Cats");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:29,代码来源:RenameTrackingTaggerProviderTests.cs

示例7: 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

示例8: RenameTrackingDeleteFromEnd

        public void RenameTrackingDeleteFromEnd()
        {
            var code = @"
class ABC$$
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.Backspace();
                state.AssertTag("ABC", "AB");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:12,代码来源:RenameTrackingTaggerProviderTests.cs

示例9: 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

示例10: RenameTrackingAlertsAboutThirdPartyRequestsForCancellationAfterRename

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

                Assert.Equal(1, state.RefactorNotifyService.OnBeforeSymbolRenamedCount);
                Assert.Equal(1, state.RefactorNotifyService.OnAfterSymbolRenamedCount);
                state.AssertNotificationMessage();

                // Make sure the rename completed            
                var expectedCode = @"
class Cats
{
    public Cats()
    {
    }
}";
                Assert.Equal(expectedCode, state.HostDocument.TextBuffer.CurrentSnapshot.GetText());
                state.AssertNoTag();
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:30,代码来源:RenameTrackingTaggerProviderTests.cs

示例11: RenameTrackingOnReference_Namespace

        public void RenameTrackingOnReference_Namespace()
        {
            var code = @"
namespace NS
{
    class C
    {
        static void M()
        {
            NS$$.C.M();
        }
    }
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("A");
                state.AssertTag("NS", "NSA");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:19,代码来源:RenameTrackingTaggerProviderTests.cs

示例12: RenameTrackingReplaceIdentifierPrefix

        public void RenameTrackingReplaceIdentifierPrefix()
        {
            var code = @"
class $$[|Ident|]ifier
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                var textSpan = state.HostDocument.SelectedSpans.Single();
                state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Complex");
                state.AssertTag("Identifier", "Complexifier");
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:13,代码来源:RenameTrackingTaggerProviderTests.cs

示例13: RenameTrackingThroughEmptyStringWithCaretMove

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

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

示例14: RenameTrackingThroughSameIdentifier

        public void RenameTrackingThroughSameIdentifier()
        {
            var code = @"
class C$$
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("s");
                state.AssertTag("C", "Cs");

                state.EditorOperations.Backspace();
                state.AssertNoTag();

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

示例15: RenameTrackingOnBothSidesOfIdentifier

        public void RenameTrackingOnBothSidesOfIdentifier()
        {
            var code = @"
class $$Def
{
}";
            using (var state = new RenameTrackingTestState(code, LanguageNames.CSharp))
            {
                state.EditorOperations.InsertText("Abc");
                state.AssertTag("Def", "AbcDef");

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


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