Example #1
0
        protected override void HandleCharactersDeletedForwards()
        {
            string previous = text;

            text = SelectionRangeUtil.DeleteTextForwards(text, ref selectionRange);
            HandleTextChanged(previous);
        }
Example #2
0
    public void DeleteTextRangeForwardFromMiddle()
    {
        string text = "Keep|Delete|Keep";

        SelectionRange range = GetSelectionFromCharacters(ref text);

        string expected = "KeepKeep";
        string result   = SelectionRangeUtil.DeleteTextForwards(text, ref range);

        Assert.AreEqual(expected, result);
        AssertSelection(result, range, "Keep|Keep");
    }
Example #3
0
    public void DeleteTextForwardFromEnd()
    {
        string text = "Keep|";

        SelectionRange range = GetCursorFromCharacter(ref text);

        string expected = "Keep";
        string result   = SelectionRangeUtil.DeleteTextForwards(text, ref range);

        Assert.AreEqual(expected, result);
        AssertSelection(result, range, "Keep|");
    }
Example #4
0
    public void DeleteTextRangeForwardFromEnd()
    {
        string text = "Keep|Delete|";

        SelectionRange range = GetSelectionFromCharacters(ref text);

        string expected = "Keep";
        string result   = SelectionRangeUtil.DeleteTextForwards(text, ref range);

        Assert.AreEqual(expected, result);
        AssertSelection(result, range, "Keep|");

        string toAdd = " ";

        result = SelectionRangeUtil.InsertText(result, ref range, toAdd);

        Assert.AreEqual("Keep ", result);
        AssertSelection(result, range, "Keep |");
    }