public ServiceInformation(Sun sun, Weather weather) { sun.Resolve(); Sunrise = sun.Sunrise; Sunset = sun.Sunset; weather.Resolve(); Temperature = weather.Temperature; }
public void WeatherAPITest() { Weather weather = new Weather(); weather.Resolve(); Assert.IsFalse(weather.ErrorDetected, string.Format(errorDownloadResponse, weather.Name)); Assert.IsTrue(weather.LastUpdatedSuccessful.HasValue); Assert.AreNotEqual<DateTime>(DateTime.MinValue, weather.LastUpdatedSuccessful.Value); Assert.IsNotNull(weather.LastResponse, string.Format(errorResponseNull, weather.Name)); Assert.IsNotNull(weather.Temperature); Assert.AreNotEqual<int>(0, weather.Temperature); }