Exemplo n.º 1
0
        public void SetLineDuplicationAtLineBeginning()
        {
            _editor.Text = "SELECT * FROM SELECTION;";
            GenericCommandHandler.DuplicateText(_editor.TextArea, null);

            _editor.Text.ShouldBe("SELECT * FROM SELECTION;\nSELECT * FROM SELECTION;");
            _editor.CaretOffset.ShouldBe(25);
        }
Exemplo n.º 2
0
        public void SetSelectionDuplicate()
        {
            _editor.Text            = "SELECT * FROM SELECTION;";
            _editor.CaretOffset     = 13;
            _editor.SelectionLength = 10;
            _editor.SelectedText.ShouldBe(" SELECTION");
            GenericCommandHandler.DuplicateText(_editor.TextArea, null);

            _editor.Text.ShouldBe("SELECT * FROM SELECTION SELECTION;");
            _editor.CaretOffset.ShouldBe(33);
        }
Exemplo n.º 3
0
        public void TestLineComments()
        {
            _editor.Text            = "SELECT * FROM SELECTION;\nSELECT * FROM RESPONDENTBUCKET";
            _editor.CaretOffset     = 13;
            _editor.SelectionLength = 35;

            GenericCommandHandler.HandleLineComments(_editor.TextArea, null);

            _editor.Text.ShouldBe("--SELECT * FROM SELECTION;\n--SELECT * FROM RESPONDENTBUCKET");
            _editor.CaretOffset.ShouldBe(52);
            _editor.SelectionLength.ShouldBe(0);
        }