提交 4a1cb061 编写于 作者: D David Poeschl

Fix integration test

上级 6b259003
......@@ -67,9 +67,21 @@ public void RenameFileToMatchType_UndoStackPreserved()
VisualStudio.Editor.Verify.CurrentLineText("public class MismatchedClassName { }");
VisualStudio.SolutionExplorer.Verify.FileContents(project, "MismatchedClassName.cs", @"public class MismatchedClassName { }");
// Undo just undoes text changes. The file rename is not undone, and the changes are not saved after the undo
// The first undo is for the file rename.
VisualStudio.Editor.Undo();
VisualStudio.Editor.Verify.CurrentLineText("public class MismatchedClassName { }");
VisualStudio.SolutionExplorer.Verify.FileContents(project, "Class1.cs", @"public class MismatchedClassName { }");
// The second undo is for the text changes.
VisualStudio.Editor.Undo();
VisualStudio.Editor.Verify.CurrentLineText("class MismatchedClassName { }");
// Redo the text changes
VisualStudio.Editor.Redo();
VisualStudio.Editor.Verify.CurrentLineText("public class MismatchedClassName { }");
// Redo the file rename
VisualStudio.Editor.Redo();
VisualStudio.SolutionExplorer.Verify.FileContents(project, "MismatchedClassName.cs", @"public class MismatchedClassName { }");
}
}
......
......@@ -697,6 +697,9 @@ public void Paste()
public void Undo()
=> ExecuteCommand(WellKnownCommandNames.Edit_Undo);
public void Redo()
=> GetDTE().ExecuteCommand(WellKnownCommandNames.Edit_Redo);
protected override ITextBuffer GetBufferContainingCaret(IWpfTextView view)
{
return view.GetBufferContainingCaret();
......
......@@ -218,6 +218,9 @@ public void Paste(string text)
public void Undo()
=> _editorInProc.Undo();
public void Redo()
=> _editorInProc.Redo();
public void NavigateToSendKeys(params object[] keys)
=> _editorInProc.SendKeysToNavigateTo(keys);
......
......@@ -15,6 +15,7 @@ public static class WellKnownCommandNames
public const string Edit_QuickInfo = "Edit.QuickInfo";
public const string Edit_ToggleCompletionMode = "Edit.ToggleCompletionMode";
public const string Edit_Undo = "Edit.Undo";
public const string Edit_Redo = "Edit.Redo";
public const string Edit_SelectionCancel = "Edit.SelectionCancel";
public const string Edit_LineStart = "Edit.LineStart";
public const string Edit_LineEnd = "Edit.LineEnd";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册