Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public IActionResult Detail(string code)
        {
            ParkViewModel parks = new ParkViewModel();

            parks.Park    = _dao.GetPark(code);
            parks.Weather = _dao.GetWeatherForecast(code);

            return(GetAuthenticatedView("Detail", parks));
        }