Esempio n. 1
0
 static void Main(string[] args)
 {
     var customMath = new CustomMath();
     var algorithm = new Algorithm();
     double r = algorithm.Run(customMath, 10, 20, 100);
     Console.WriteLine("r={0}", r);
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var    customMath = new CustomMath();
            var    algorithm  = new Algorithm();
            double r          = algorithm.Run(customMath, 10, 20, 100);

            Console.WriteLine("r={0}", r);
        }
Esempio n. 3
0
 public double Run(CustomMath customMath, double x, double y, double z)
 {
     double xy = customMath.Calc(x, y);
     if (xy < 0)
         throw new AlgorithmNegativeCalcException();
     if (xy == 0)
         xy = (x+y)/10;
     double r = xy + z;            
     return r;
 }
Esempio n. 4
0
        public double Run(CustomMath customMath, double x, double y, double z)
        {
            double xy = customMath.Calc(x, y);

            if (xy < 0)
            {
                throw new AlgorithmNegativeCalcException();
            }
            if (xy == 0)
            {
                xy = (x + y) / 10;
            }
            double r = xy + z;

            return(r);
        }
 public void Test()
 {
     var customMath = new CustomMath();
     Assert.AreEqual(30, customMath.Calc(10, 20));
 }