public void TestGetAllCampgroundsParkIDDate()
        {
            //Arrange
            CampgroundSQLDAL campgroundDAL = new CampgroundSQLDAL(connectionString);

            //Act
            int campgroundCount = campgroundDAL.GetAllCampgroundsParkID(1).Count;

            //Assert
            Assert.IsNotNull(campgroundCount);
            Assert.AreEqual(numberOfAvailableCampgrounds, campgroundCount);
        }
Example #2
0
        public void DisplayCampgrounds(bool datesAreGiven)
        {
            CampgroundSQLDAL  dal         = new CampgroundSQLDAL(connectionString);
            List <Campground> campgrounds = new List <Campground>();

            if (datesAreGiven)
            {
                campgrounds = dal.GetAllCampgroundsParkIDDate(newCampsite.ParkId, newReservation.FromDate, newReservation.ToDate);
            }
            else
            {
                campgrounds = dal.GetAllCampgroundsParkID(newCampsite.ParkId);
            }

            foreach (var campground in campgrounds)
            {
                Console.WriteLine(campground.CampID + "- " + campground.Name);
            }
        }