AjLang.Tests.Compiler.LexerTests.GetNameSkipCommentAndGetEndOfLineName C# (CSharp) Method

GetNameSkipCommentAndGetEndOfLineName() private method

private GetNameSkipCommentAndGetEndOfLineName ( ) : void
return void
        public void GetNameSkipCommentAndGetEndOfLineName()
        {
            Lexer lexer = new Lexer("foo# this is a name\r\nbar");

            Token token = lexer.NextToken();

            Assert.IsNotNull(token);
            Assert.AreEqual("foo", token.Value);
            Assert.AreEqual(TokenType.Name, token.Type);

            token = lexer.NextToken();

            Assert.IsNotNull(token);
            Assert.AreEqual(TokenType.EndOfLine, token.Type);

            token = lexer.NextToken();

            Assert.IsNotNull(token);
            Assert.AreEqual("bar", token.Value);
            Assert.AreEqual(TokenType.Name, token.Type);

            Assert.IsNull(lexer.NextToken());
        }