示例#1
0
        public void IfSimpleExpressionNotCorrectThenException()
        {
            string exp = "256 # (-2)";
            Parser target = new Parser(mathOperations.Object);

            target.ParseSimpleExp(exp);
        }
示例#2
0
        public void IsParseSimleExpressionCorrect()
        {
            string exp = "256 * (-2)";
            Parser target = new Parser(mathOperations.Object);

            OperationInfo result = target.ParseSimpleExp(exp);

            Assert.AreEqual(result.OperandLeft, 256);
            Assert.AreEqual(result.OperandRight, -2);
            Assert.AreEqual(result.OperationSymbol, '*');
        }