예제 #1
0
        private int Calculate(MathematicModel model)
        {
            switch (model.Operation)
            {
            case Operations.Add:
                return(_mathematics.Add(model.First, model.Second));

            case Operations.Subtract:
                return(_mathematics.Subtract(model.First, model.Second));

            default:
                throw new NotSupportedException();
            }
        }
예제 #2
0
 public void Subtract_Test()
 {
     Assert.That(_mathematics.Subtract(5, 2) == 3);
     Assert.That(_mathematics.Subtract(5, 10) == -5);
     Assert.That(_mathematics.Subtract(5, -2) == 7);
 }