public void TimeZoneService_Works_During_DST() { // Arrange var request = new TimeZoneRequest { Location = new LatLng(52.8723, 0.8551), Timestamp = new DateTime(2017, 6, 13) }; // Act var response = new TimeZoneService().GetResponse(request); // Assert Assert.AreEqual(ServiceResponseStatus.Ok, response.Status); Assert.AreEqual("Europe/London", response.TimeZoneID); Assert.AreEqual("British Summer Time", response.TimeZoneName); Assert.AreEqual(3600, response.DstOffSet); }
public void TimeZoneService_Works_Outside_DST() { // Arrange var request = new TimeZoneRequest { Location = new LatLng(52.8723, 0.8551), Timestamp = new DateTime(2017, 1, 1) }; // Act var response = new TimeZoneService().GetResponse(request); // Assert Assert.AreEqual(ServiceResponseStatus.Ok, response.Status); Assert.AreEqual("Europe/London", response.TimeZoneID); Assert.AreEqual("Greenwich Mean Time", response.TimeZoneName); Assert.AreEqual(0, response.DstOffSet); }
TimeZoneService CreateService() { var svc = new TimeZoneService(TestingApiKey); return(svc); }