public void ChangeFootballStadium_should_return_NewNameOfStadium()
        {
            //arrange

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

            football.AddFoortballStadium("hello");
            string name     = "hello";
            int    index    = 0;
            string expected = "hello";

            //act
            football.ChangeFootballStadium(name, index);
            //assert
            Assert.Equal(expected, football[index].Name);
        }
Esempio n. 2
0
        public void NameofStadium()
        {
            while (true)
            {
                Console.Clear();
                Console.WriteLine("Name\n1. Add name of the stadium\n2. Change name of the stadium\n0.  Back");
                Console.Write("Action: ");
                string choise = Console.ReadLine();
                Console.Clear();
                switch (choise)
                {
                case "0":
                    return;

                case "1":
                    try
                    {
                        Console.Write("Name of the stadium: ");
                        var name = validator.validator_name(Console.ReadLine());
                        Fts.AddFoortballStadium(name);
                    }
                    catch (Exception e) { Console.WriteLine(e.Message); Console.ReadKey(); }
                    break;

                case "2":
                    try
                    {
                        Console.WriteLine("Change name of stadium");
                        int index = IndexFootball();
                        Console.WriteLine("Add new name of game");
                        string name = validator.validator_name(Console.ReadLine());
                        Fts.ChangeFootballStadium(name, index);
                    }
                    catch (Exception e) { Console.WriteLine(e.Message); Console.ReadKey(); }
                    break;

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