public void InsertVenueTest() { if (database == null) { database = new Database(TestUtils.ConnString); } Assert.NotNull(database); var venueDao = new VenueDao(database); InsertDummyData(venueDao); Assert.Equal(items.Count, venueDao.Count()); }
public void FindAllVenuesTest() { if (database == null) { database = new Database(TestUtils.ConnString); } Assert.NotNull(database); var venueDao = new VenueDao(database); InsertDummyData(venueDao); Assert.Equal(items.Count, venueDao.Count()); IList<Venue> dbVenues = venueDao.FindAll(); Assert.NotNull(dbVenues); Assert.Equal(items.Count, dbVenues.Count); foreach (var venue in dbVenues) { Assert.True(items.Contains(venue)); } }
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()); }
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()); }
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); }
public void FindVenueWhereSpecatorsTest() { 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 venues = venueDao.FindWhereSpectators(50); Assert.NotNull(venues); Assert.Equal(2, venues.Count); }
public void FindVenueByLocationIdTest() { 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 venues = venueDao.FindByLocationId(LOCATION_ID); Assert.NotNull(venues); Assert.Equal(items.Count, venues.Count); }