// Gets a single parks information private Park GetPark(int parkId) { IParkDAL parkdal = new ParkSqlDAL(DatabaseConnectionString.DatabaseString); Park park = parkdal.GetPark(parkId); return(park); }
public void GetParkTest() { ParkSqlDAL parkSqlDAL = new ParkSqlDAL(connectionString); Park park = parkSqlDAL.GetPark("AAA"); Assert.AreEqual("Test Park National Park", park.Name); Assert.IsNotNull(park); }
public ActionResult Detail(string id) { ParkSqlDAL dal = new ParkSqlDAL(connectionString); Parks parkModel = dal.GetPark(id); ViewBag.weather = id; return(View("Detail", parkModel)); }
public void GetParkTest_name() { Parks result = new Parks(); ParkSqlDAL parks = new ParkSqlDAL(connectionString); result = parks.GetPark("ENP"); Assert.AreEqual("Everglades National Park", result.Name); }
public void GetParkTest_climate() { Parks result = new Parks(); ParkSqlDAL parks = new ParkSqlDAL(connectionString); result = parks.GetPark("ENP"); Assert.AreEqual("Tropical", result.Climate); }
public void GetPark_GetsPark() { // Arrange ParkSqlDAL PSDal = new ParkSqlDAL(ConnectionString); // Act Park park = PSDal.GetPark(1); // Assert Assert.AreEqual("Testpark", park.Name); }
public void GetParkTest() { //Arrange ParkSqlDAL dal = new ParkSqlDAL(connectionString); //Act List <Park> listOfParks = dal.GetPark(); //Assert Assert.AreEqual(1, listOfParks.Count()); Assert.AreEqual("Test Park", listOfParks[0].name); }
public IActionResult Detail(string id) { var park = pdal.GetPark(id); //Get weather results for said park var weather = wdal.GetWeatherForPark(id); var model = new ParkDetailModel() { Park = park, ParkWeather = weather }; return(View(model)); }
public void GetParkTest() //Park GetPark(string parkCode) { //Arrange IParkDAL parkSqlDAL = new ParkSqlDAL(connectionString); //ACT Park park = parkSqlDAL.GetPark("YNP2"); //Assert Assert.IsNotNull(park, "Yosemite was not found"); Assert.AreEqual("California", park.State, "Yosemite should be in California"); Assert.AreEqual(1890, park.YearFounded, "Incorrect YearFounded associated with Yosemite. Should be 1890"); }
private void GetPark() { ParkSqlDAL dal = new ParkSqlDAL(DatabaseConnection); List <Park> parks = dal.GetPark(); if (parks.Count > 0) { parks.ForEach(p => { Console.WriteLine(p); }); } else { Console.WriteLine("****NO RESULTS****"); } }