Exemple #1
0
        public void AddOperation_Test()
        {
            AddOperation op = new AddOperation(new Integer(2), new Integer(4));

            Assert.AreEqual(6, op.Value);
            Assert.AreEqual("2 + 4", op.ToString());
        }
        public void Equation_Test2()
        {
            //Try to represent the equation 1 + 2 -3
            IEquation node1 = new AddOperation(new Integer(1), new Integer(2));

            Assert.AreEqual(3, node1.Value);

            AddOperation equation = new AddOperation(node1, new Integer(3));

            Assert.AreEqual(6, equation.Value);
            Assert.AreEqual("1 + 2 + 3", equation.ToString());
        }