Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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();
        }