public void ChangeComad_should_AddNewNameOfComands()
        {
            //arrange
            string first  = "First";
            string second = "Second";

            var football = new FootballStadiumService(new XMLProvider <FootballStadium>("footballl.xml"));

            int index = 0;

            football.AddComand("das", "dsa");



            //act
            football.AddComand(first, second);
            //assert

            Assert.NotNull(football[index]);
        }
예제 #2
0
        public void AddComandServ()
        {
            while (true)
            {
                Console.Clear();
                Console.WriteLine("Comand\n1. Add comand \n2.  Add command for index\n0.  Back");
                Console.Write("Action: ");
                string choise = Console.ReadLine();
                Console.Clear();
                switch (choise)
                {
                case "0":
                    return;

                case "1":
                    try
                    {
                        Console.WriteLine("Write nane of first comand");
                        string namefirst = validator.validator_name(Console.ReadLine());
                        Console.WriteLine("Write nane of second comand");
                        string namesecond = validator.validator_name(Console.ReadLine());
                        Fts.AddComand(namefirst, namesecond);
                    }
                    catch (Exception e) { Console.WriteLine(e.Message); Console.ReadKey(); }
                    break;

                case "2":
                    try
                    {
                        int index = IndexFootball();
                        Console.WriteLine("Write name of first comands");
                        string namefirst = validator.validator_name(Console.ReadLine());
                        Console.WriteLine("Write nane of second comand");
                        string namesecond = validator.validator_name(Console.ReadLine());
                        Fts.ChangeComad(index, namefirst, namesecond);
                    }
                    catch (Exception e) { Console.WriteLine(e.Message); Console.ReadKey(); }
                    break;

                default:
                    Console.WriteLine("Wrong index\nPress any key to continue...");
                    Console.ReadKey();
                    break;
                }
            }
        }