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); }
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 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)); }