Esempio n. 1
0
        public void UnrecognizedTokenDetected()
        {
            TheLexer lexer  = new TheLexer();
            var      tokens = lexer.GetTokens("3 xyz 5");

            Assert.AreEqual(1, tokens.Count(p => p.GetType() == typeof(UnrecognizedToken)));
        }
Esempio n. 2
0
        public void ValidExpressionContainsNoUnrecognizedTokens()
        {
            TheLexer lexer  = new TheLexer();
            var      tokens = lexer.GetTokens("3 + 5");

            Assert.AreEqual(0, tokens.Count(p => p.GetType() == typeof(UnrecognizedToken)));
        }