AjScript.Tests.Interpreter.LexerTests.ParseNegativeInteger C# (CSharp) Method

ParseNegativeInteger() private method

private ParseNegativeInteger ( ) : void
return void
        public void ParseNegativeInteger()
        {
            Lexer lexer = new Lexer("-42");

            var token = lexer.NextToken();

            Assert.IsNotNull(token);
            Assert.AreEqual(TokenType.Operator, token.TokenType);
            Assert.AreEqual("-", token.Value);

            token = lexer.NextToken();

            Assert.IsNotNull(token);
            Assert.AreEqual("42", token.Value);
            Assert.AreEqual(TokenType.Integer, token.TokenType);

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