Exemple #1
0
        public void MinusCalcTest(double first, double second, double expected)
        {
            var    calc   = new MinusCalc();
            double result = calc.Calculate(first, second);

            Assert.AreEqual(expected, result);
        }
Exemple #2
0
        public SuperCalc CreateCalc(string strCalcType)
        {
            SuperCalc InnerCalc = null;

            switch (strCalcType)
            {
            case "+":
                InnerCalc = new AddCalc();
                break;

            case "-":
                InnerCalc = new MinusCalc();
                break;

            case "*":
                InnerCalc = new MultiCalc();
                break;

            case "/":
                InnerCalc = new DiviCalc();
                break;

            default:
                break;
            }
            return(InnerCalc);
        }