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