public void NextCantMove_When_LastCharacterIsReached() { ParseStream stream = new ParseStream("/t"); stream.Next(); stream.Next(); stream.Next(); Assert.AreEqual(stream.Index.Index, 1); }
public void HasMoreShouldBeFalse_WhenIndex_IsAtTheLastCharacter() { ParseStream stream = new ParseStream("/text"); stream.Next(); stream.Next(); stream.Next(); stream.Next(); Console.WriteLine(stream.Text.Length + "=" + stream.Index.Index); Assert.AreEqual(stream.Current, 't'); Assert.False(stream.HasMore); }
public void HasMoreShouldBeTrue_WhenIndex_IsLowerThanLength() { ParseStream stream = new ParseStream("/text"); stream.Next(); Assert.True(stream.HasMore); }
public void ShouldThrow_WhenCurrentCharIsIncorrect() { //Move cursor on char 't' after the /. stream.Next(); TagParser parser = new TagParser(stream); Assert.Catch <InvalidOperationException>(() => parser.Parse()); }
public void CurrentCharShouldTheCharOfTheIndex() { ParseStream stream = new ParseStream("/text"); stream.Next(); Assert.AreEqual(stream.Current, 't'); }
public void NextShouldIncrementIndex() { ParseStream stream = new ParseStream("/text"); stream.Next(); Assert.AreEqual(stream.Index.Index, 1); }