public void GetUpdatedTimeShouldReturnNullButNotThrowIfMissingUpdatedTime() { var d = GetDeviceWithMissingUpdatedTime(); var updatedTime = DeviceSchemaHelper.GetUpdatedTime(d); Assert.AreEqual(null, updatedTime); }
public void GetUpdatedTimeShouldReturnUpdatedTime() { var d = GetValidDevice(); var updatedTime = DeviceSchemaHelper.GetUpdatedTime(d); // Need to include RoundtripKind to get a UTC value var expectedTime = DateTime.Parse("2015-09-01T01:02:03.0000Z", null, DateTimeStyles.RoundtripKind); Assert.AreEqual(expectedTime, updatedTime); }
public void GetUpdatedTimeShouldThrowIfMissingDeviceProperties() { var d = GetDeviceWithMissingDeviceProperties(); Assert.Throws <DeviceRequiredPropertyNotFoundException>(() => DeviceSchemaHelper.GetUpdatedTime(d)); }