コード例 #1
0
        public void CalculatorOperationTest6()
        {
            CalculatorOperation calculatorOperation = new CalculatorOperation();
            List <string>       input = new List <string> {
                "5", "+", "6", "+"
            };

            Assert.ThrowsException <System.FormatException>(() => calculatorOperation.PerformCalculation(input));
        }
コード例 #2
0
        public void CalculatorOperationTest2()
        {
            CalculatorOperation calculatorOperation = new CalculatorOperation();
            List <string>       input = new List <string> {
                "5", "2", "*", "10", "+"
            };
            var actualResult   = calculatorOperation.PerformCalculation(input);
            var expectedResult = 20;

            Assert.AreEqual(expectedResult, actualResult);
        }