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