예제 #1
0
        public void MoveCaretPageUp_WrappedEmpty_CorrectResults()
        {
            var sut = new ConControls.Controls.Text.ConsoleTextController
            {
                WrapMode = WrapMode.SimpleWrap,
                Width    = 5
            };

            sut.MoveCaretPageUp(Point.Empty, 5).Should().Be(Point.Empty);
            sut.MoveCaretPageUp(new Point(1, 1), 5).Should().Be(Point.Empty);
        }
예제 #2
0
        public void MoveCaretPageUp_WrappedNonEmpty_CorrectResults()
        {
            var sut = new ConControls.Controls.Text.ConsoleTextController
            {
                Text     = "Line1Line2L3\nLine4",
                WrapMode = WrapMode.SimpleWrap,
                Width    = 5
            };

            sut.MoveCaretPageUp(Point.Empty, 5).Should().Be(Point.Empty);
            sut.MoveCaretPageUp(new Point(1, 1), 5).Should().Be(new Point(1, 0));
            sut.MoveCaretPageUp(new Point(3, 3), 1).Should().Be(new Point(2, 2));
        }
예제 #3
0
        public void MoveCaretPageUp_UnwrappedNonEmpty_CorrectResults()
        {
            var sut = new ConControls.Controls.Text.ConsoleTextController
            {
                Text     = "Line1\nLine2\nLine3\nLongLine4",
                WrapMode = WrapMode.NoWrap,
                Width    = 5
            };

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