public void ParkInformationTest() { //Adds and verifies new park has been added to list int parkCount = _dao.GetParkList().Count; AddPark(); int newParkCount = _dao.GetParkList().Count; Assert.AreEqual(parkCount + 1, newParkCount); //Tests that the park information was pulled correctly for //the chosen park string parkCode = "TE"; var testPark = _dao.GetPark(parkCode); Assert.AreEqual("Tech Elevator", testPark.ParkName); Assert.AreEqual("Ohio", testPark.State); Assert.AreEqual(1, testPark.Acreage); Assert.AreEqual(30, testPark.ElevationInFeet); Assert.AreEqual(1, testPark.MilesOfTrail); Assert.AreEqual(2, testPark.NumberOfCampsites); Assert.AreEqual(2019, testPark.YearFounded); Assert.AreEqual(30, testPark.AnnualVisitors); Assert.AreEqual("Do what you want", testPark.InspirationalQuote); Assert.AreEqual("Chris Rupp", testPark.QuoteSource); Assert.AreEqual("Elevate yourself", testPark.ParkDescription); Assert.AreEqual(15500, testPark.EntryFee); Assert.AreEqual(1, testPark.NumberOfAnimalSpecies); //Adds fake weather to the park and tests how many days //of forecast were returned AddWeatherForecast(); Assert.AreEqual(1, _dao.GetWeatherForecast(parkCode).Count); }
private IList <SelectListItem> ParkDropdown() { IList <SelectListItem> parkDropDown = new List <SelectListItem>(); IList <Park> parkList = _dao.GetParkList(); foreach (var park in parkList) { parkDropDown.Add(new SelectListItem() { Text = park.ParkName, Value = park.ParkCode }); } return(parkDropDown); }
public IActionResult Index() { IList <Park> ListOfParks = _dao.GetParkList(); return(GetAuthenticatedView("Index", ListOfParks)); }