public void TestCopyPasteSingleLine()
 {
     textCore.SetCursorPosition(0, 0);
     textCore.SetOverrideModifierFlag(TextEditorCommand.Modifier.Shift);
     textCore.SetCursorPosition(5, 0);
     Assert.AreEqual(textCore.GetSelectionText(), "hello");
     textCore.DoCopyText(false);
     textCore.SetCursorPosition(0, 2);
     textCore.DoPasteText();
     Assert.AreEqual(textCore.GetLine(2), "hello\t\tcruel\n");
     Assert.AreEqual(textCore.CursorPosition.X, 5);
     Assert.AreEqual(textCore.CursorPosition.Y, 2);
 }
Ejemplo n.º 2
0
 public void TestCopyPaste01()
 {
     textCore.SetCursorPosition(0, 0);
     textCore.SetOverrideModifierFlag(TextEditorCommand.Modifier.Shift);
     textCore.DoNavigation(Key.Right);
     textCore.SetOverrideModifierFlag(TextEditorCommand.Modifier.Shift);
     textCore.DoNavigation(Key.Right);
     textCore.SetOverrideModifierFlag(TextEditorCommand.Modifier.Shift);
     textCore.DoNavigation(Key.Right);
     Assert.AreEqual(textCore.GetSelectionText(), "hel");
     textCore.DoCopyText(false);
     Assert.AreEqual(textCore.GetLine(0), "hello\n");
     textCore.SetCursorPosition(0, 3);
     textCore.DoPasteText();
     Assert.AreEqual(textCore.GetLine(3), "hel\tworld");
 }