public void AddTest(double first, double second, double expected) { Raznost calculator = new Raznost(); double result = calculator.Calculate(first, second); Assert.AreEqual(expected, result); }
static void Main(string[] args) { Console.WriteLine("Выберите операцию(+,-,*)"); Sum S = new Sum(); Raznost R = new Raznost(); Umnozh U = new Umnozh(); string selection = Console.ReadLine(); if (selection == "+") { Console.WriteLine("Введите первое число"); int a = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Введите второе число"); int b = Convert.ToInt32(Console.ReadLine()); S.sum(a, b); Console.WriteLine("Выберите операцию(+,-,*)"); } else if (selection == "-") { Console.WriteLine("Введите первое число"); int a = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Введите второе число"); int b = Convert.ToInt32(Console.ReadLine()); R.raz(a, b); Console.WriteLine("Выберите операцию(+,-,*)"); } else if (selection == "*") { Console.WriteLine("Введите первое число"); int a = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Введите второе число"); int b = Convert.ToInt32(Console.ReadLine()); U.proizv(a, b); Console.WriteLine("Выберите операцию(+,-,*)"); } }