Esempio n. 1
0
        public static void Main(string[] args)
        {
            while (true)
            {
                Console.WriteLine("Options:");
                Console.WriteLine("  1 - Generate test cases");
                Console.WriteLine("  2 - Execute test cases");
                Console.WriteLine("  3 - Display grammar");
                Console.WriteLine("  X - Exit");
                Console.WriteLine();

                Console.Write("Enter option: ");
                string option = Console.ReadLine().Trim().ToUpper();

                switch (option)
                {
                    case "1":
                        {
                            Console.Write("Enter Y to confirm: ");
                            string confirm = Console.ReadLine().Trim().ToUpper();
                            if (confirm == "Y")
                            {
                                foreach (string programName in ProgramNames)
                                {
                                    ProgramTest programTest = new ProgramTest(programName);
                                    programTest.CreateTestResults();
                                }
                            }
                        }
                        break;

                    case "2":
                        {
                            foreach (string programName in ProgramNames)
                            {
                                ProgramTest programTest = new ProgramTest(programName);
                                programTest.ValidateTestResults();
                            }
                        }
                        break;

                    case "3":
                        {
                            DisplayGrammar();
                        }
                        break;

                    case "X":
                        {
                            // No action required.
                        }
                        break;

                    default:
                        {
                            Console.WriteLine("Unrecognized input {0}.", option);
                        }
                        break;
                }

                if (option == "X")
                {
                    break;
                }

                Console.WriteLine();
            }
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            HelloWorld();

            return;

            while (true)
            {
                Console.WriteLine("Options:");
                Console.WriteLine("  1 - Generate test cases");
                Console.WriteLine("  2 - Execute test cases");
                Console.WriteLine("  3 - Display grammar");
                Console.WriteLine("  X - Exit");
                Console.WriteLine();

                Console.Write("Enter option: ");
                string option = Console.ReadLine().Trim().ToUpper();

                switch (option)
                {
                case "1":
                {
                    Console.Write("Enter Y to confirm: ");
                    string confirm = Console.ReadLine().Trim().ToUpper();
                    if (confirm == "Y")
                    {
                        foreach (string programName in ProgramNames)
                        {
                            ProgramTest programTest = new ProgramTest(programName);
                            programTest.CreateTestResults();
                        }
                    }
                }
                break;

                case "2":
                {
                    foreach (string programName in ProgramNames)
                    {
                        ProgramTest programTest = new ProgramTest(programName);
                        programTest.ValidateTestResults();
                    }
                }
                break;

                case "3":
                {
                    DisplayGrammar();
                }
                break;

                case "X":
                {
                    // No action required.
                }
                break;

                default:
                {
                    Console.WriteLine("Unrecognized input {0}.", option);
                }
                break;
                }

                if (option == "X")
                {
                    break;
                }

                Console.WriteLine();
            }
        }