Beispiel #1
0
        public void Get()
        {
            Country addedCountry = new Country("Israel");

            countryDAO.Add(addedCountry);
            addedCountry = countryDAO.GetCountryByName("Israel");

            Assert.AreEqual("Israel", countryDAO.Get(addedCountry.ID).CountryName);
        }
        public void Add()
        {
            countryDAO.Add(new Country("Israel"));

            airlineDAO.Add(new AirlineCompany("ElAl", "ElAl2004", "123456", countryDAO.GetCountryByName("Israel").ID));
            Assert.AreEqual("ElAl", airlineDAO.GetAirlineByName("ElAl").AirLineName);
            Assert.AreEqual("ElAl2004", airlineDAO.GetAirlineByName("ElAl").UserName);
            Assert.AreEqual("123456", airlineDAO.GetAirlineByName("ElAl").Password);
            Assert.AreEqual(countryDAO.GetCountryByName("Israel").ID, airlineDAO.GetAirlineByName("ElAl").CountryCode);
        }
        public void Add()
        {
            countryDAO.Add(new Country("Israel"));
            Country israel = countryDAO.GetCountryByName("Israel");

            airlineDAO.Add(new AirlineCompany("ELAL", "USERNAME", "PASSWORD", israel.ID));
            AirlineCompany elal = airlineDAO.GetAirlineByName("ELAL");

            flightDAO.Add(new Flight(elal.ID, israel.ID, israel.ID, new DateTime((DateTime.Now.Year + 2), 12, 5, 14, 00, 00), new DateTime((DateTime.Now.Year + 2), 12, 7, 14, 00, 00), 50, FlightStatus.NotDeparted));
            Assert.AreEqual(1, flightDAO.GetAll().Count);
        }