public void TestNextTokenReturnsValidToken() { var m = new Mock<ITokenizer<TokenType>>(); m.Setup(t => t.GetNextToken(It.IsAny<bool>())).Returns(new Token<TokenType>()); var l = new CLexer(m.Object); var token = l.GetNextToken(); Assert.That(token, Is.Not.Null); }
public void TestPushToken() { var token = CToken.Create(new Token<TokenType>()); var m = new Mock<ITokenizer<TokenType>>(); var l = new CLexer(m.Object); l.PushToken(token); var otherToken = l.GetNextToken(); Assert.That(otherToken, Is.EqualTo(token)); }