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); }
public void SchouldReturnMultiplicationOfImputsForMultiply() { //arrange var x = 10; var y = 5; var calc = new TestKalkulatora.ExampleCalculator(); //act var result = calc.Multiply(x, y); //assert Assert.Equal(50, result); }
public void SchouldReturnSubtractionOfImputsForSubtract() { //arrange var x = 10; var y = 5; var calc = new TestKalkulatora.ExampleCalculator(); //act var result = calc.Subtract(x, y); //assert Assert.Equal(5, result); }
public void SchouldReturnSumOfImputsForAdd() { //arrange var x = 5; var y = 10; var calc = new TestKalkulatora.ExampleCalculator(); //act var result = calc.Add(x, y); //assert Assert.Equal(15, 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(); }