public void LookBehind_ReturnsPreviousCharacter(string line, int amountOfCheckings) { var reader = new MdStringReader(line); var currentChar = reader.LookAhead(); for (var i = 0; i < amountOfCheckings; i++) { reader.ShiftPointer(); reader.LookBehind().Should().Be(currentChar); currentChar = reader.LookAhead(); } }
public void LookAhead_ReturnsCurrentCharacter(string line, int startPosition, char expected) { var reader = new MdStringReader(line); for (var i = 0; i < startPosition; i++) { reader.ShiftPointer(); } reader.LookAhead().Should().Be(expected); }