public void NationalParkDALMethods() { NationalParkDAL _park = new NationalParkDAL(_connectionString); //GetParks() and PopulateParkFromReader() - second method contained within first List <Park> parkList = _park.GetParks(); Assert.IsNotNull(parkList); //GetCampgroundsByPark() and PopulateCampgroundFromReader() - second method contained within first List <Campground> campList = _park.GetCampgroundsByPark(parkList[0]); Assert.IsNotNull(campList); //GetSitesByCampground() and PopulateSiteFromReader() - second method contained within first List <Site> siteList = _park.GetSitesByCampground(campList[0].Id); Assert.IsNotNull(siteList); //GetSitesForUser() and PopulateCustomItemFromReader() - second method contained within first DateTime userArrDate = new DateTime(2018, 08, 01); DateTime userDepDate = new DateTime(2018, 08, 30); List <CustomItem> sitesForUser = _park.GetSitesForUser(campList[0].Id, userArrDate, userDepDate); Assert.IsNotNull(sitesForUser); //MakeReservation() int confirmNum = _park.MakeReservation(siteList[0].SiteId, "TEST FAMILY NAME", userArrDate, userDepDate); Assert.IsNotNull(confirmNum); }
/// <summary> /// Returns a list of sites from the database filtered by the user's chosen campground, arrival date, and departure date /// Will only allow the user to see sites that are not already reserved for their chosen time period /// </summary> public List <CustomItem> GetSitesForUser(int campgroundId, DateTime fromDate, DateTime toDate) { return(_db.GetSitesForUser(campgroundId, fromDate, toDate)); }