public void PlusFunktionTest4()
        {
            //Arrange

            var cal = new BasicOperations(2, 2);

            //Act

            double result = cal.PlusFunktion();

            //Assert

            Assert.AreEqual(4, result);
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("-------------- Velkommen til din nye lommeregner --------------");

            Console.WriteLine("Indtast dit første tal...");
            string Tal1  = Console.ReadLine();
            double temp1 = Double.Parse(Tal1);

            Console.WriteLine("Indtast en operator...");
            string Operator = Console.ReadLine();

            Console.WriteLine("Indtast dit andet tal...");
            string Tal2  = Console.ReadLine();
            double temp2 = Double.Parse(Tal2);

            var calc = new BasicOperations(temp1, temp2);

            switch (Operator)
            {
            case "+":
                Console.WriteLine(calc.PlusFunktion());
                break;

            case "-":
                Console.WriteLine(calc.MinusFunktion());
                break;

            case "*":
                Console.WriteLine(calc.GangeFunktion());
                break;

            case "/":
                Console.WriteLine(calc.DividerFunktion());
                break;

            default:
                Console.WriteLine("Indtast venligst en korrekt operator.");
                break;
            }
        }