Beispiel #1
0
        public void NumberToCountry_EverythingTested_AllOk()
        {
            MainSystem system   = new MainSystem();
            Country    actual   = system.NumberToCountry(1);
            Country    expected = Country.Uruguay;

            Assert.AreEqual(actual, expected);

            actual   = system.NumberToCountry(2);
            expected = Country.Argentina;
            Assert.AreEqual(actual, expected);
        }
Beispiel #2
0
        private void ShowBtn_Click(object sender, EventArgs e)
        {
            this.reservationsListView.Items.Clear();
            DateTime start  = this.startDateTime.Value;
            DateTime finish = this.endDateTime.Value;
            Country  country;

            if (countrySelector.SelectedIndex == 2)
            {
                country = 0;
            }
            else
            {
                country = system.NumberToCountry(countrySelector.SelectedIndex + 1);
            }

            ReservationRequestLetter RRL = new ReservationRequestLetter
            {
                EndTime   = finish,
                StartTime = start,
            };

            if (country != 0)
            {
                RRL.Country = country;
            }
            try
            {
                Reserve[] reservations = system.GetPeriodTimeReservations(RRL);
                if (reservations != null)
                {
                    foreach (Reserve item in reservations)
                    {
                        this.reservationsListView.Items.Add(item.ToString());
                    }
                }
                else
                {
                    this.reservationsListView.Items.Add("Empty");
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Beispiel #3
0
 private void CountrySelector_SelectedIndexChanged(object sender, EventArgs e)
 {
     system.Country = system.NumberToCountry(countrySelector.SelectedIndex + 1);
 }