Esempio n. 1
0
        public void TestInsertText01()
        {
            textCore.SetCursorPosition(0, 0);
            //Cursor Position should be 0,0

            textCore.InsertText("this is now the first line\n");
            Assert.AreEqual(textCore.GetLine(0), "this is now the first line\n");
        }
 public void TestUndoEditing()
 {
     textCore.SetCursorPosition(3, 0);
     textCore.InsertText("testest");
     Assert.AreEqual(textCore.GetLine(0), "heltestestlo\n");
     textCore.UndoEditing();
     Assert.AreEqual(textCore.GetLine(0), "hello\n");
     textCore.UndoEditing();
     Assert.AreEqual(textCore.GetLine(0), "hello\n");
     Assert.AreEqual(textCore.LineCount, 4);
 }
        public void TestControlLeftOnLastLine01()
        {
            textCore.SetCursorPosition(6, 3);
            textCore.InsertText("\n");
            Assert.AreEqual(textCore.CurrentTextBuffer.GetLineContent(3), "    world\n");
            textCore.SetCursorPosition(0, 4);

            textCore.SetOverrideModifierFlag(TextEditorCommand.Modifier.Control);
            textCore.DoNavigation(System.Windows.Input.Key.Left);

            Assert.AreEqual(textCore.CursorPosition.X, 9);
            Assert.AreEqual(textCore.CursorPosition.Y, 3);
        }