public void GetCampgrounds_Test()
        {
            Campground_DAL testCampgroundDAL = new Campground_DAL();
            Park_DAL       testParkDAL       = new Park_DAL();
            Park           testPark          = testParkDAL.GetParks()[1];

            // use the test park's id since it's an int
            IList <Campground> testResults = testCampgroundDAL.GetCampgroundsByPark(testPark.ParkID);

            // make sure we're getting the right campground
            Assert.AreEqual(1, testResults[0].CampID);
        }
        public void GetCampsites_Test()
        {
            Campground_DAL     testCampgroundDAL = new Campground_DAL();
            Campsite_DAL       testCampsiteDAL   = new Campsite_DAL();
            Park_DAL           testParkDAL       = new Park_DAL();
            Park               testPark          = testParkDAL.GetParks()[2];
            IList <Campground> testCampgrounds   = testCampgroundDAL.GetCampgroundsByPark(testPark.ParkID);
            List <Campsite>    testCampsites     = testCampsiteDAL.GetCampsitesByCampground(testCampgrounds[0].CampID, DateTime.Parse("2018-10-10"), DateTime.Parse("2018-10-12"));
            int siteCount = testCampsites.Count;

            // check the count of sites to make sure we're getting the right data
            Assert.AreEqual(1, siteCount);
        }
Beispiel #3
0
        /// <summary>
        /// Creates list of campgrounds within user-selected park
        /// </summary>
        private void GetCampgroundsByPark()
        {
            int    parkForCampgrounds = parksAvailable[parkToDisplay].ParkID;
            string parkName           = parksAvailable[parkToDisplay].Name;

            campgrounds = campDAL.GetCampgroundsByPark(parkForCampgrounds);

            Console.Clear();
            Console.WriteLine("Park Campgrounds");
            Console.WriteLine(parkName);
            Console.WriteLine();

            PresentCampgroundInfo(campgrounds);

            CampgroundSubMenu();
            CampsiteCommands(GetUserInputString());

            Console.WriteLine();

            return;
        }