Esempio n. 1
0
        public void MoveCaretPageDown_WrappedEmpty_CorrectResults()
        {
            var sut = new ConControls.Controls.Text.ConsoleTextController
            {
                WrapMode = WrapMode.SimpleWrap,
                Width    = 5
            };

            sut.MoveCaretPageDown(Point.Empty, 5).Should().Be(Point.Empty);
            sut.MoveCaretPageDown(new Point(1, 1), 5).Should().Be(Point.Empty);
        }
Esempio n. 2
0
        public void MoveCaretPageDown_WrappedNonEmpty_CorrectResults()
        {
            var sut = new ConControls.Controls.Text.ConsoleTextController
            {
                Text     = "Line1Line2L3\nLine4",
                WrapMode = WrapMode.SimpleWrap,
                Width    = 5
            };

            sut.MoveCaretPageDown(Point.Empty, 5).Should().Be(new Point(0, 4));
            sut.MoveCaretPageDown(new Point(1, 1), 5).Should().Be(new Point(0, 4));
            sut.MoveCaretPageDown(new Point(3, 0), 2).Should().Be(new Point(2, 2));
        }
Esempio n. 3
0
        public void MoveCaretPageDown_UnwrappedNonEmpty_CorrectResults()
        {
            var sut = new ConControls.Controls.Text.ConsoleTextController
            {
                Text     = "Line1\nLine2\nLongLine3\nLine4",
                WrapMode = WrapMode.NoWrap,
                Width    = 5
            };

            sut.MoveCaretPageDown(Point.Empty, 5).Should().Be(new Point(0, 3));
            sut.MoveCaretPageDown(new Point(1, 1), 5).Should().Be(new Point(1, 3));
            sut.MoveCaretPageDown(new Point(3, 3), 2).Should().Be(new Point(3, 3));
            sut.MoveCaretPageDown(new Point(7, 2), 2).Should().Be(new Point(5, 3));
        }