本文整理汇总了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");
}
}
示例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");
}
}
示例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();
}
}
示例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");
}
}