public void AddDayofGame_should_AddDayofTheGame()
        {
            //arrange
            FootballStadium footballStadia = new FootballStadium();
            var             football       = new FootballStadiumService(new XMLProvider <FootballStadium>("footballl.xml"));
            int             day            = 10;
            var             expected       = footballStadia.DayoOfGame = 10;

            //act
            football.AddDayofGame(day);
            //assert
            Assert.Equal(expected, footballStadia.DayoOfGame);
        }
        public void ChangeDayofGame_should_AddNewPriceOfTicket()
        {
            //arrange

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

            football.AddDayofGame(1);
            int day      = 10;
            int idex     = 0;
            var expected = 10;

            //act
            football.ChangeDayofGame(day, idex);
            //assert
            Assert.Equal(expected, football[idex].DayoOfGame);
        }
Esempio n. 3
0
        public void DayofGameForStadium()
        {
            while (true)
            {
                Console.Clear();
                Console.WriteLine("Day\n1. Add day of the game\n2. Change day of the game\n0.  Back");
                Console.Write("Action: ");
                string choise = Console.ReadLine();
                Console.Clear();
                switch (choise)
                {
                case "0":
                    return;

                case "1":
                    try
                    {
                        Console.Write("Add day of the game: ");
                        var day = validator.validator_day(Console.ReadLine());
                        Fts.AddDayofGame(Convert.ToInt32(day));
                    }
                    catch (Exception e) { Console.WriteLine(e.Message); Console.ReadKey(); }
                    break;

                case "2":
                    try
                    {
                        Console.WriteLine("Change day of game");
                        int index = IndexFootball();
                        Console.WriteLine("Add new time of game");
                        var data = validator.validator_day(Console.ReadLine());
                        Fts.ChangeDayofGame(Convert.ToInt32(data), index);
                    }
                    catch (Exception e) { Console.WriteLine(e.Message); Console.ReadKey(); }
                    break;

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