Beispiel #1
0
        public void TestEmptyLineSelectionBehaviorMoveUp()
        {
            var data = CreateData("\n\n\n");

            data.Caret.Location = new DocumentLocation(2, 3);
            SelectionActions.MoveUp(data);
            Assert.AreEqual(new DocumentLocation(1, 3), data.Caret.Location);
            Assert.AreEqual(new DocumentLocation(1, 3), data.MainSelection.Lead);
            Assert.AreEqual(new DocumentLocation(2, 3), data.MainSelection.Anchor);
        }
 void IEditorOperations.MoveLineUp(bool extendSelection)
 {
     if (extendSelection)
     {
         SelectionActions.MoveUp(TextEditor.GetTextEditorData());
     }
     else
     {
         CaretMoveActions.Up(TextEditor.GetTextEditorData());
     }
 }
        public void TestMoveUp()
        {
            TextEditorData data = CaretMoveActionTests.Create(@"1234567890
1234567890
1234$567890
1234567890
1234567890");

            SelectionActions.MoveUp(data);
            Assert.AreEqual(new Selection(DocumentLocation.MinLine + 2, DocumentLocation.MinColumn + 4, DocumentLocation.MinLine + 1, DocumentLocation.MinColumn + 4), data.MainSelection);
        }
Beispiel #4
0
        public void TestMoveUp()
        {
            TextEditorData data = CaretMoveActionTests.Create(@"1234567890
1234567890
1234$567890
1234567890
1234567890");

            SelectionActions.MoveUp(data);
            Assert.AreEqual(new Selection(2, 4, 1, 4), data.MainSelection);
        }
Beispiel #5
0
        public void TestDeleteSelectionBehavior()
        {
            var data = CreateData("\n\t\ttest\n\n");

            data.Caret.Location = new DocumentLocation(2, 3);
            SelectionActions.MoveUp(data);
            Assert.AreEqual(new DocumentLocation(1, 3), data.Caret.Location);
            Assert.IsTrue(data.IsSomethingSelected);
            DeleteActions.Delete(data);
            Assert.AreEqual(new DocumentLocation(1, 3), data.Caret.Location);
            Assert.AreEqual("\t\ttest\n\n", data.Document.Text);
        }