public void TestExplicitDateTime_OverflowSeconds() { var source = new Timestamp(MessagePackConvert.FromDateTimeOffset(DateTimeOffset.MaxValue) + 1L, checked (( int )(DateTimeOffset.MaxValue.Ticks % 10000000 * 100))); Assert.Throws <InvalidOperationException>(() => { var x = ( DateTime )source; }); }
public void TestToDateTime_OverflowNanoseconds() { var source = new Timestamp(MessagePackConvert.FromDateTimeOffset(DateTimeOffset.MaxValue) + 1, 0); Assert.Throws <InvalidOperationException>(() => source.ToDateTime()); }