Exemplo n.º 1
0
        static void RunProgram(ref bool programRunning)
        {
            int x = InputHandling.ReadValue("Type in a value to calculate it's factorial: ");

            Console.WriteLine("How do you want to calculate the factorial? R - Recursion, I - Iteration");
            Factorial.CalculateFactorial(x);
            OutputHandling.Question("Do you want to determine the factorial of another number? Y / N");
            programRunning = InputHandling.QuestionOptions();
        }
Exemplo n.º 2
0
        public void TestFactorial(int value, int expected)
        {
            int actual = Factorial.CalculateFactorial(value);

            Assert.Equal(expected, actual);
        }