Exemplo n.º 1
0
        public void CityRead()
        {
            Booking.Models.City c      = new Models.City(9999, "Test");
            Booking.DB.DbCity   dbCity = new DB.DbCity();

            dbCity.Delete(9999);
            dbCity.Create(c);

            Assert.IsNotNull(dbCity.Get(9999));
        }
Exemplo n.º 2
0
        public void CityCreate()
        {
            Booking.Models.City c      = new Models.City(9999, "Test");
            Booking.DB.DbCity   dbCity = new DB.DbCity();

            dbCity.Delete(9999);

            Assert.IsNull(dbCity.Get(9999));

            dbCity.Create(c);



            Assert.AreEqual(c.Zipcode, dbCity.Get(9999).Zipcode);
        }
Exemplo n.º 3
0
        public void CityUpdate()
        {
            Booking.Models.City c      = new Models.City(9999, "Test");
            Booking.DB.DbCity   dbCity = new DB.DbCity();

            dbCity.Delete(9999);
            dbCity.Create(c);

            Assert.AreEqual(dbCity.Get(9999).CityName, "Test");

            c.CityName = "Changed";

            dbCity.Update(c);

            Assert.AreEqual(dbCity.Get(9999).CityName, "Changed");
        }
Exemplo n.º 4
0
        public void CityDelete()
        {
            Booking.Models.City c      = new Models.City(9999, "Test");
            Booking.DB.DbCity   dbCity = new DB.DbCity();

            dbCity.Delete(9999);
            dbCity.Create(c);

            if (dbCity.Get(9999).Zipcode == c.Zipcode)
            {
                dbCity.Delete(9999);
                Assert.IsNull(dbCity.Get(9999));
            }
            else
            {
                Assert.Fail();
            }
        }