protected virtual void assertToken(int expectedLineNumber, Type expectedClazz, String expectedValue) { Token token = lexer.next(); Assert.AreEqual(token.getValue(), (expectedValue)); Assert.AreEqual(token.getLineNumber(), (expectedLineNumber)); Assert.AreEqual(token.GetType(), expectedClazz); }
public void shouldReturnALookaheadToken() //throws Exception { Token token = lexer1.next(); assertThat(token.ToString(), ("div")); Assert.AreEqual(token.GetType(), typeof(Tag)); token = lexer1.next(); assertThat(token.ToString(), ("indent")); Assert.AreEqual(token.GetType(), typeof(Indent)); token = lexer1.next(); assertThat(token.ToString(), ("h1")); Assert.AreEqual(token.GetType(), typeof(Tag)); token = lexer1.next(); assertThat(token.ToString(), ("outdent")); Assert.AreEqual(token.GetType(), typeof(Outdent)); token = lexer1.next(); Assert.AreEqual(token.GetType(), typeof(Eos)); }
public void shouldReturnAnEOFTagIfEmptyFile() //throws Exception { assertThat(lexer2.next().getValue(), ("eos")); }