コード例 #1
0
        public void CheckNameExistance()
        {
            countryDAO.Add(new Country("Israel"));

            AirlineCompany airlineOne = new AirlineCompany("NAME", "USERNAME", "PASSWORD", countryDAO.GetCountryByName("Israel").ID);
            AirlineCompany airlineTwo = new AirlineCompany("NAME2", "USERNAME2", "PASSWORD2", countryDAO.GetCountryByName("Israel").ID);

            airlineDAO.Add(airlineOne);
            airlineDAO.Add(airlineTwo);
            airlineOne = airlineDAO.GetAirlineByName("NAME");
            airlineTwo = airlineDAO.GetAirlineByName("NAME2");

            Assert.AreEqual(false, airlineDAO.CheckNameExistance("NAME", airlineOne.ID));
            Assert.AreEqual(true, airlineDAO.CheckNameExistance("NAME", airlineTwo.ID));
        }