Esempio n. 1
0
        static void Main(string[] args)
        {
            CalculatorLib.Calculator obj = new CalculatorLib.Calculator();

            int result = obj.Add(10, 20);

            Console.WriteLine(result);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // Compiler will reflect CalculatorLib metadata
            CalculatorLib.Calculator obj = new CalculatorLib.Calculator();

            int result = obj.Add(10, 20);

            Console.WriteLine(result);
        }
        public void TestAdd2And2()
        {
            double a        = 2;
            double b        = 2;
            double expected = 4;
            var    calc     = new CalculatorLib.Calculator();
            double actual   = calc.Add(a, b);

            Assert.Equal(expected, actual);
        }
Esempio n. 4
0
        public void Add1and1equals3()
        {
            //Arrange
            var calc     = new CalculatorLib.Calculator();
            int expected = 3;

            //Act
            int result = calc.Add(1, 1);

            //Assert
            Assert.AreEqual(expected, result);
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            var calculator = new CalculatorLib.Calculator(10);

            Console.WriteLine("Введите число а: ");
            int a = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Введите число b: ");
            int b = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Сумма равна ");
            Console.WriteLine(calculator.Add(a, b));
        }