Ejemplo n.º 1
0
        public void TestMove_NextPrevious()
        {
            TextCursor cursor = MakeCursor("test");

            ValidateBeginningOfString(cursor);
            Assert.True(cursor.Move(2), "Move(2)");
            ValidateCurrentCharacter(cursor, 2, 's');
            Assert.True(cursor.MovePrevious(), "MovePrevious()");
            ValidateCurrentCharacter(cursor, 1, 'e');
            Assert.True(cursor.MoveNext(), "MoveNext()");
            ValidateCurrentCharacter(cursor, 2, 's');
            Assert.True(cursor.MovePrevious()); // 1
            Assert.True(cursor.MovePrevious()); // 0
            Assert.False(cursor.MovePrevious());
            ValidateCurrentCharacter(cursor, -1, '\0');
            Assert.False(cursor.MovePrevious());
            ValidateCurrentCharacter(cursor, -1, '\0');
        }