Ejemplo n.º 1
0
 public void MouseEventTest01()
 {
     textCore.SetCursorPosition(2, 0);
     textCore.SetOverrideModifierFlag(TextEditorCommand.Modifier.Shift);
     textCore.SetMouseDownPosition(2, 3, null);
     textCore.SetMouseUpPosition(2, 3, null);
     Assert.AreEqual(textCore.GetSelectionText(), "llo\n\n\t\tcruel\n\tw");
     Assert.AreEqual(textCore.SelectionEnd, new Point(2, 3));
     Assert.AreEqual(textCore.SelectionStart, new Point(2, 0));
 }
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");
 }
        public void TestBackwardSelectionOnSameLine()
        {
            // Selection by going backward on the same line.
            textCore.SetCursorPosition(6, 2);
            textCore.SetOverrideModifierFlag(TextEditorCommand.Modifier.Shift);
            textCore.SetCursorPosition(1, 2);

            Assert.AreEqual(textCore.SelectionStart.X, 1);
            Assert.AreEqual(textCore.SelectionStart.Y, 2);
            Assert.AreEqual(textCore.SelectionEnd.X, 6);
            Assert.AreEqual(textCore.SelectionEnd.Y, 2);
            Assert.AreEqual(textCore.GetSelectionText(), "\tcrue");
        }
Ejemplo n.º 4
0
 public void TestSelectLines01()
 {
     textCore.SelectLines(2, 2);
     Assert.AreEqual(textCore.GetSelectionText(), "\t\tcruel\n\tworld");
 }