Ejemplo n.º 1
0
        public void TestPrintIncompleteMultiply()
        {
            BinaryOperator multiplyOperation = new MultiplicationOperator();

            multiplyOperation.SetFirstOperand(new Value(1));
            Assert.AreEqual("1 × ".Replace(" ", ""), multiplyOperation.ToString().Replace(" ", ""));
        }
Ejemplo n.º 2
0
        public void TestMultiplication()
        {
            BinaryOperator multiplicationExpression = new MultiplicationOperator();

            multiplicationExpression.SetFirstOperand(new Value(1.1M));
            multiplicationExpression.SetSecondOperand(new Value(2M));
            Assert.AreEqual(2.2M, multiplicationExpression.Evaluate());
        }
Ejemplo n.º 3
0
        public void TestPrintMultiplicationExpression()
        {
            BinaryOperator multiplicationOperation = new MultiplicationOperator();

            multiplicationOperation.SetFirstOperand(new Value(2.9M));
            multiplicationOperation.SetSecondOperand(new Value(3));
            Assert.AreEqual("2.9 × 3".Replace(" ", ""), multiplicationOperation.ToString().Replace(" ", ""));
        }