/// <summary> /// Once a park is selected, goes to the data base and gets all the data /// for the park, its campgrounds and its sites. /// This data shouldn't change super frequently. /// </summary> /// <param name="park"></param> private void GetAllInfo(Park park) { ParkSqlDAL parkDAL = new ParkSqlDAL(DatabaseConnection); parkDAL.GetParkInfo(park); CampgroundSqlDAL campgroundDAL = new CampgroundSqlDAL(DatabaseConnection); campgroundDAL.GetCampgroundInfo(park); SiteSqlDAL siteDAL = new SiteSqlDAL(DatabaseConnection); siteDAL.GetSiteInfo(park); }
public void GetSiteInfo_Test() { SiteSqlDAL dal = new SiteSqlDAL(ConnectionString); Park testPark = new Park(1); Campground testCampground = new Campground(); testCampground.CampgroundID = 1; testPark.Campgrounds.Add(testCampground); dal.GetSiteInfo(testPark); Assert.AreEqual(1, testCampground.Sites.Count); }