Beispiel #1
0
        public void CountryFuncsTest()
        {
            FlightDAOMSSQL flight = new FlightDAOMSSQL();

            flight.RemoveAll();
            CountryDAOMSSQL c = new CountryDAOMSSQL();

            c.RemoveAll();
            AirlineDAOMSSQL airline = new AirlineDAOMSSQL();

            airline.RemoveAll();
            Country c1, c2;

            c1 = new Country("UAE"); c2 = new Country("England");
            CountryDAOMSSQL country = new CountryDAOMSSQL();

            country.RemoveAll();
            country.Add(c1);
            country.Add(c2);
            country.Remove(c2);
            IList <Country> countries      = country.GetAll();
            Country         updatedCountry = country.Get(c1.Id); updatedCountry.CountryName = "Spain";

            country.Update((updatedCountry));
            Assert.AreEqual(updatedCountry, countries[0]);
        }