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); }
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)); }
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)); }