public void MoveRightBug() { Init(); lines.SetText( "123\n" + "" ); PlaceIterator iterator = lines.GetCharIterator(0); char c; Assert.True(iterator.MoveRight(out c)); Assert.True(iterator.MoveRight(out c)); Assert.AreEqual('2', c); Assert.True(iterator.MoveRight(out c)); Assert.AreEqual('3', c); Assert.True(iterator.MoveRight(out c)); Assert.AreEqual('\n', c); Assert.False(iterator.MoveRight(out c)); Assert.AreEqual('\0', c); Assert.True(iterator.MoveLeft(out c)); Assert.AreEqual('\n', c); }
public void LeftRightChar_Idle() { Init(); lines.SetText("123456"); PlaceIterator iterator = lines.GetCharIterator(1); AssertLeftRight(iterator, '1', '2'); }
private void AssertLeftRight(PlaceIterator iterator, char left, char right) { char iteratorLeft = iterator.LeftChar; char iteratorRight = iterator.RightChar; Assert.True(iteratorLeft == left && iteratorRight == right, ("expected: (" + left + ", " + right + "), was: (" + iteratorLeft + ", " + iteratorRight + ")").Replace("\0", "\\0")); }
public void LeftRightChar_AfterMoveLeft() { Init(); lines.SetText("123456"); PlaceIterator iterator = lines.GetCharIterator(3); iterator.MoveLeftWithRN(); AssertLeftRight(iterator, '2', '3'); }