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


C# RenameTrackingTestState.Undo方法代码示例

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


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

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

示例2: RenameTrackingUndoTwiceAndContinueSession

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

                state.AssertNoTag();

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

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

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

示例4: RenameTrackingUndoOnceAndStartNewSession

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

                state.AssertNoTag();

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

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


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