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 GetParks_Test() { // Arrange Park_DAL testDAL = new Park_DAL(); // Act IList <Park> testResults = testDAL.GetParks(); int parksCount = testResults.Count; // Assert Assert.AreEqual(3, parksCount); }
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); }