Example #1
0
        public static void UnitTestMenu(Assembly assembly, ConsoleMenu[] otherMenus, string header)
        {
            Console.WriteLine(header);
            ITestRunner <UnitTestMethod> runner = GetUnitTestRunner(assembly, Log.Default);

            ShowActions(runner.GetTests());
            Console.WriteLine();
            Console.WriteLine("Q to quit\ttype all to run all tests.");
            string answer = ShowSelectedMenuOrReturnAnswer(otherMenus);

            Console.WriteLine();

            try
            {
                answer = answer.Trim().ToLowerInvariant();
                runner.RunSpecifiedTests(answer);
            }
            catch (Exception ex)
            {
                Error("An error occurred running tests", ex);
            }

            if (Confirm("Return to the Test menu? [y][N]"))
            {
                UnitTestMenu(assembly, otherMenus, header);
            }
            else
            {
                Exit(0);
            }
        }