Arithmetica.Tests.Tokenization.TokenTests.Token_Can_Get_Operator_Precedence C# (CSharp) Метод

Token_Can_Get_Operator_Precedence() приватный Метод

private Token_Can_Get_Operator_Precedence ( ) : void
Результат void
        public void Token_Can_Get_Operator_Precedence()
        {
            // Non operators.
            Assert.AreEqual(0, new Token(TokenType.OpeningParenthesis, "(").GetPrecedence());
            Assert.AreEqual(0, new Token(TokenType.ClosingParenthesis, ")").GetPrecedence());
            Assert.AreEqual(0, new Token(TokenType.Numeric, 0D).GetPrecedence());
            Assert.AreEqual(0, new Token(TokenType.Variable, "x").GetPrecedence());
            Assert.AreEqual(0, new Token(TokenType.Function, "func").GetPrecedence());
            // Operators
            Assert.AreEqual(1, new Token(TokenType.Addition, "+").GetPrecedence());
            Assert.AreEqual(1, new Token(TokenType.Subtraction, "-").GetPrecedence());
            Assert.AreEqual(2, new Token(TokenType.Multiplication, "*").GetPrecedence());
            Assert.AreEqual(2, new Token(TokenType.Division, "/").GetPrecedence());
            Assert.AreEqual(3, new Token(TokenType.Exponentiation, "^").GetPrecedence());
            Assert.AreEqual(4, new Token(TokenType.Negation, "-").GetPrecedence());
        }