public void NegateExpressionConstructorTest()
        {
            Expression operand1 = new ValueExpression(3); // TODO: Initialize to an appropriate value
            NegateExpression target = new NegateExpression(operand1);

            Assert.AreEqual<Expression>(operand1, target.Operand);
        }
        public void PowerExpressionConstructorTest()
        {
            Expression operand1 = new ValueExpression(3); // TODO: Initialize to an appropriate value
            Expression operand2 = new ValueExpression(5); // TODO: Initialize to an appropriate value
            PowerExpression target = new PowerExpression(operand1, operand2);

            Assert.AreEqual<Expression>(operand1, target.Operand1);
            Assert.AreEqual<Expression>(operand2, target.Operand2);
        }
        public void AddExpressionConstructorTest()
        {
            Expression operand1 = new ValueExpression(4); // TODO: Initialize to an appropriate value
            Expression operand2 = new ValueExpression(5); // TODO: Initialize to an appropriate value
            AddExpression target = new AddExpression(operand1, operand2);

            Assert.AreEqual<Expression>(operand1, target.Operand1, "Operand1 set improperly.");
            Assert.AreEqual<Expression>(operand2, target.Operand2, "Operand2 set improperly.");
        }
 public void ToStringTest()
 {
     double value = 0F; // TODO: Initialize to an appropriate value
     ValueExpression target = new ValueExpression(value); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     actual = target.ToString();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void SolveTest()
 {
     double value = 0F; // TODO: Initialize to an appropriate value
     ValueExpression target = new ValueExpression(value); // TODO: Initialize to an appropriate value
     Expression expected = null; // TODO: Initialize to an appropriate value
     Expression actual;
     actual = target.Solve();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
        public void SolveTest()
        {
            Expression operand1 = new ValueExpression(10); // TODO: Initialize to an appropriate value
            NegateExpression target = new NegateExpression(operand1); // TODO: Initialize to an appropriate value
            Expression expected = new ValueExpression(-10); // TODO: Initialize to an appropriate value
            Expression actual;
            actual = target.Solve();

            Assert.AreEqual(expected, actual);
        }
        public void SolveTest()
        {
            Expression operand1 = new ValueExpression(3); // TODO: Initialize to an appropriate value
            Expression operand2 = new ValueExpression(4); // TODO: Initialize to an appropriate value
            AddExpression target = new AddExpression(operand1, operand2); // TODO: Initialize to an appropriate value

            Expression expected = new ValueExpression(7); // TODO: Initialize to an appropriate value
            Expression actual;
            actual = target.Solve();
            Assert.AreEqual<Double>(((ValueExpression)expected).GetValue(), ((ValueExpression)actual).GetValue());
        }
        public void SolveTest()
        {
            Expression operand1 = new ValueExpression(10); // TODO: Initialize to an appropriate value
            Expression operand2 = new ValueExpression(4); // TODO: Initialize to an appropriate value
            MultiplyExpression target = new MultiplyExpression(operand1, operand2); // TODO: Initialize to an appropriate value

            Expression actual;
            actual = target.Solve();

            Assert.AreEqual<Double>(((ValueExpression)actual).GetValue(), 40);
        }
        public void SolveTest()
        {
            Expression operand1 = new ValueExpression(10); // TODO: Initialize to an appropriate value
            Expression operand2 = new ValueExpression(2); // TODO: Initialize to an appropriate value
            DivideExpression target = new DivideExpression(operand1, operand2); // TODO: Initialize to an appropriate value

            Expression expected = new ValueExpression(5); // TODO: Initialize to an appropriate value
            Expression actual;
            actual = target.Solve();

            Assert.AreEqual(((ValueExpression)expected).GetValue(), ((ValueExpression)actual).GetValue());
        }
        public void SolveZeroTest()
        {
            Expression operand1 = new ValueExpression(4); // TODO: Initialize to an appropriate value
            Expression operand2 = new ValueExpression(0); // TODO: Initialize to an appropriate value
            DivideExpression target = new DivideExpression(operand1, operand2);

            Expression actual = target.Solve();

            Assert.IsTrue(Double.IsInfinity(((ValueExpression)actual).GetValue()));
        }
 public void ValueExpressionConstructorTest()
 {
     double value = 0F; // TODO: Initialize to an appropriate value
     ValueExpression target = new ValueExpression(value);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
 public void SolveTest()
 {
     Expression operand1 = new ValueExpression(2); // TODO: Initialize to an appropriate value
     Expression operand2 = new ValueExpression(3); // TODO: Initialize to an appropriate value
     PowerExpression target = new PowerExpression(operand1, operand2); // TODO: Initialize to an appropriate value
     Expression expected = new ValueExpression(8); // TODO: Initialize to an appropriate value
     Expression actual;
     actual = target.Solve();
     Assert.AreEqual<ValueExpression>((ValueExpression)expected , (ValueExpression)actual);
 }