Example #1
0
        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);
        }
Example #2
0
 /// <summary>
 /// Inserts a new reservation into the database
 /// Contains the user's site choice, a name for the reservation, arrival date, and departure date
 /// </summary>
 public int MakeReservation(int userSiteChoice, string userResName, DateTime userArrDate, DateTime userDepDate)
 {
     return(_db.MakeReservation(userSiteChoice, userResName, userArrDate, userDepDate));
 }