public void DIvidingTwoPositiveDoubles_paratremised(double x, double y, double expected) { //arrange var calc = new TestKalkulatora.ExampleCalculator(); //act var result = calc.Divide(x, y); //assert Assert.Equal(expected, result); }
public void SchouldReturnDivisionOfImputsForDivide() { //arrange var x = 10; var y = 5; var calc = new TestKalkulatora.ExampleCalculator(); //act var result = calc.Divide(x, y); //assert Assert.Equal(2, result); }
static void Main(string[] args) { Console.WriteLine("Press: 1 - dodawanie, 2 -odejmowanie, 3 - mnozenie, 4 - dzielenie"); var operationType = int.Parse(Console.ReadLine()); var x = int.Parse(Console.ReadLine()); var y = int.Parse(Console.ReadLine()); var calc = new ExampleCalculator(); double result = 0; if (operationType == 1) { result = calc.Add(x, y); } if (operationType == 2) { result = calc.Subtract(x, y); } if (operationType == 3) { result = calc.Multiply(x, y); } if (operationType == 4) { result = calc.Divide(x, y); } Console.WriteLine("-------"); Console.WriteLine(result); Console.ReadLine(); }