public void CalculateTest() { Div calculator = new Div(); Assert.AreEqual(2.5, calculator.Calculate(5, 2)); Assert.AreEqual(2, calculator.Calculate(10, 5)); Assert.AreEqual(1, calculator.Calculate(4, 4)); }
public void CalculateTest(double firstValue, double secondValue, double expected) { var calculator = new Div(); var actualResult = calculator.Calculate(firstValue, secondValue); Assert.AreEqual(expected, actualResult); }
public void CalculateAdditionTestStrong(double firstValue, double secondValue, double expected) { ITwoArgumentsCalculator calculator = new Div(); double result = calculator.Calculate(25, 2); Assert.AreEqual(12, result); }
public void CalculateDelTestStrong(double firstValue, double secondValue, double expected) { ITwoArgumentCalculator calculator = new Div(); double result = calculator.Calculate(firstValue, secondValue); Assert.AreEqual(expected, result); }
public void CalculateTest(double firstArgument, double secondArgument, double result, double accracy) { var testingFunction = new Div(); var testResult = testingFunction.Calculate(firstArgument, secondArgument); Assert.AreEqual(result, testResult, accracy); }
//client static void Main(string[] args) { // build the following expression ((((2+5)-1)*4)/3) Number a = new Number(2); Number b = new Number(5); Add addition = new Add(a, b); Number c = new Number(1); Sub subtraction = new Sub(addition, c); Number d = new Number(4); Multi multiplication = new Multi(subtraction, d); Number e = new Number(3); Div divide = new Div(multiplication, e); Console.WriteLine("\nResult of: {0} is: {1}\n", divide.Show(), divide.Calculate()); Console.WriteLine("Result of: {0} is: {1}", multiplication.Show(), multiplication.Calculate()); Console.ReadKey(); }
public void CalculateTest() { Div calculator = new Div(); Assert.Throws <System.DivideByZeroException>(() => calculator.Calculate(1, 0)); }
public void DivisionTestByZero() { var calculator = new Div(); var result = calculator.Calculate(5, 0); }