Exemplo n.º 1
0
        public void ShouldResultInLogicalOutcome01()
        {
            // For
            string operation      = "6-3*2/2-3";
            double expectedResult = 0;

            // Given
            ArithmeticLogicEngine arithmeticLogicEngine = new ArithmeticLogicEngine();
            double result = arithmeticLogicEngine.ExecuteOperation(operation);

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
Exemplo n.º 2
0
        public void ShouldResultInLogicalOutcome05()
        {
            // For
            string operation      = "5*(10-4/2+(100*5-50/5)+15*2)-31";
            double expectedResult = 2609;

            // Given
            ArithmeticLogicEngine arithmeticLogicEngine = new ArithmeticLogicEngine();
            double result = arithmeticLogicEngine.ExecuteOperation(operation);

            // Assert
            Assert.AreEqual(expectedResult, result);
        }