Beispiel #1
0
        public void FindVenueByIdTest()
        {
            if (database == null)
            {
                database = new Database(TestUtils.ConnString);
            }
            Assert.NotNull(database);

            var venueDao = new VenueDao(database);
            InsertDummyData(venueDao);
            Assert.Equal(items.Count, venueDao.Count());

            var currVenue = items[0];

            var myVenue = venueDao.FindById(currVenue.Id, currVenue.Location.Id);
            Assert.NotNull(myVenue);
            Assert.Equal(currVenue, myVenue);

            venueDao.Delete(myVenue.Id, myVenue.Location.Id);
            Assert.Equal(items.Count - 1, venueDao.Count());
        }
Beispiel #2
0
        public void DeleteVenueTest()
        {
            if (database == null)
            {
                database = new Database(TestUtils.ConnString);
            }
            Assert.NotNull(database);

            var venueDao = new VenueDao(database);
            InsertDummyData(venueDao);
            Assert.Equal(items.Count, venueDao.Count());

            foreach (var item in items)
            {
                venueDao.Delete(item.Id, item.Location.Id);
            }
            Assert.Equal(0, venueDao.Count());
        }