Example #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());
        }
Example #2
0
        public void UpdateVenueTest()
        {
            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];
            currVenue.Label = ALTER_LABEL;

            venueDao.Update(currVenue);
            var myNewVenue = venueDao.FindById(currVenue.Id, currVenue.Location.Id);
            Assert.NotNull(myNewVenue);
            Assert.Equal(ALTER_LABEL, myNewVenue.Label);
        }