Example #1
0
        public static void Serialize(TestCase testCase, string type)
        {
            var serializer = new XmlSerializer(typeof(TestCase));

            using (var writer = XmlWriter.Create(@".\TCs\TestCase" + type + ".xml"))
            {
                serializer.Serialize(writer, testCase);
            }
        }
Example #2
0
        public void DisplayMenu()
        {
            Boolean exit = false;
            Automation executer = new Automation();
            do
            {
                centerText("Automation TC 7zip");
                centerText("=========================");
                Console.WriteLine("Type an option:");
                Console.WriteLine("1.Create Test Case ");
                Console.WriteLine("2.Executed Test Case");
                Console.WriteLine("3.Change 7zip path");
                Console.WriteLine("4.Exit");
                var initOption = Console.ReadLine();
                switch(initOption)
                {
                    case "1":
                        Console.WriteLine("Type an option:");
                        Console.WriteLine("1. File");
                        Console.WriteLine("2. Folder");
                        var dataOption = Console.ReadLine();
                        switch (dataOption)
                        {
                            case "1":
                                Console.WriteLine("Put the entry data");
                                Console.WriteLine("Type the path File");
                                var pathFile = Console.ReadLine();
                                extensionMenu();
                                //executer.CreateFileTCs;
                                if (!exit)
                                {
                                    TestCase tc = new TestCase();
                                    //executer.CreateFileTCs;
                                }
                                else
                                {
                                    Console.ForegroundColor = ConsoleColor.Red;
                                    displayErrorMessage("ERROR : Invalid data was entered");
                                    Console.ResetColor();
                                }

                                break;

                            case "2":
                                Console.WriteLine("Put the entry data");
                                Console.WriteLine("Type the path File");
                                var pathFolder = Console.ReadLine();
                                break;

                        }
                        break;
                    case "3":
                        Console.WriteLine("Type the path File");
                        var path7zip = Console.ReadLine();
                        break;
                    case "4":
                        exit = true;
                        break;
                }

            } while (!exit);
        }