public void ChangeCountofPlace_should_AddCountOfPlace_2()
        {
            //arrange

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

            football.AddCountOfPlace(1);
            int place    = 2;
            int index    = 0;
            var expected = 2;

            //act
            football.ChangeCountofPlace(index, place);
            //assert
            Assert.Equal(expected, football[index].NumberofPlace);
        }
Exemplo n.º 2
0
        public void CountofPlace()
        {
            while (true)
            {
                Console.Clear();
                Console.WriteLine("Place\n1. Add count of place\n2. Change count of place\n0.  Back");
                Console.Write("Action: ");
                string choise = Console.ReadLine();
                Console.Clear();
                switch (choise)
                {
                case "0":
                    return;

                case "1":
                    try
                    {
                        Console.Write("(Count of place < 100) Add count of place: ");
                        var place = validator.validator_countplace(Console.ReadLine());
                        Fts.AddCountOfPlace(Convert.ToInt32(place));
                    }
                    catch (Exception e) { Console.WriteLine(e.Message); Console.ReadKey(); }
                    break;

                case "2":
                    try
                    {
                        Console.WriteLine("(Count of place < 100) Change count of place");
                        int ind = IndexFootball();
                        Console.Write("New count of place: ");
                        var place = validator.validator_countplace(Console.ReadLine());

                        Fts.ChangeCountofPlace(ind, Convert.ToInt32(place));
                    }
                    catch (Exception e) { Console.WriteLine(e.Message); Console.ReadKey(); }
                    break;

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