/// <summary> /// Populates ParkViewModel park details and weather forecast with one specific park obtained by Park ID. /// Uses two DAO methods. One to obtain specific park details, the other to obtain five day weather forecast of that park. /// </summary> /// <param name="id"></param> /// <returns></returns> private ParkViewModel PopulateParkDetails(string id) { var park = _db.GetParkById(id); var forecast = _db.GetWeatherById(id); ParkViewModel vm = new ParkViewModel(); populatePark(vm, park[0]); SetDegreeSymbol(forecast, vm); return(vm); }
public void TestWeather() { Weather wT = new Weather() { Code = "AIK", Low = 14, High = 130, Forecast = "Doom", DayValue = 6 }; _db.CreateWeather(wT); var tr = _db.GetWeatherById("AIK"); Assert.AreEqual(14, tr[0].Low); Assert.AreEqual(6, tr[0].DayValue); Assert.AreEqual("Doom", tr[0].Forecast); }