public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(new Interval(SampleStart, SampleEnd)); TestHelper.AssertBinaryRoundtrip(new Interval(null, SampleEnd)); TestHelper.AssertBinaryRoundtrip(new Interval(SampleStart, null)); TestHelper.AssertBinaryRoundtrip(new Interval(null, null)); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip( new OffsetDateTime(new LocalDateTime(2013, 4, 12, 17, 53, 23).PlusNanoseconds(1), Offset.FromHours(1))); TestHelper.AssertBinaryRoundtrip( new OffsetDateTime(new LocalDateTime(2013, 4, 12, 17, 53, 23, CalendarSystem.Julian).PlusNanoseconds(1), Offset.FromHours(1))); }
public void BinarySerialization() { var time = new LocalTime(5, 6, 7).PlusNanoseconds(123456789L); var offset = Offset.FromHoursAndMinutes(5, 30); var value = new OffsetTime(time, offset); TestHelper.AssertBinaryRoundtrip(value); }
public void BinarySerialization() { var date = new LocalDate(2013, 4, 12); var offset = Offset.FromHoursAndMinutes(5, 30); var value = new OffsetDate(date, offset); TestHelper.AssertBinaryRoundtrip(value); }
public void BinarySerialization_Iso() { DateTimeZoneProviders.Serialization = DateTimeZoneProviders.Tzdb; var zone = DateTimeZoneProviders.Tzdb["America/New_York"]; var value = new ZonedDateTime(new LocalDateTime(2013, 4, 12, 17, 53, 23).WithOffset(Offset.FromHours(-4)), zone); TestHelper.AssertBinaryRoundtrip(value); }
public void BinarySerialization_NonIso() { DateTimeZoneProviders.Serialization = DateTimeZoneProviders.Tzdb; var zone = DateTimeZoneProviders.Tzdb["America/New_York"]; var localDateTime = new LocalDateTime(2013, 6, 12, 17, 53, 23, CalendarSystem.Julian); var value = new ZonedDateTime(localDateTime.WithOffset(Offset.FromHours(-4)), zone); TestHelper.AssertBinaryRoundtrip(value); }
public void BinaryRoundTrip() { TestHelper.AssertBinaryRoundtrip(Period.Zero); // Check each field is distinct TestHelper.AssertBinaryRoundtrip(new Period(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L)); // Check we're not truncating to Int32... TestHelper.AssertBinaryRoundtrip(new Period(long.MaxValue, long.MaxValue, long.MaxValue, long.MaxValue, long.MaxValue, long.MinValue, long.MinValue, long.MinValue, long.MinValue)); }
public void BinaryRoundTrip() { TestHelper.AssertBinaryRoundtrip(Period.Zero); // Check each field is distinct TestHelper.AssertBinaryRoundtrip(new Period(1, 2, 3, 4, 5L, 6L, 7L, 8L, 9L, 10L)); // Check we're not truncating to Int32... (except for date values) TestHelper.AssertBinaryRoundtrip(new Period(int.MaxValue, int.MaxValue, int.MinValue, int.MinValue, long.MaxValue, long.MinValue, long.MinValue, long.MinValue, long.MinValue, long.MinValue)); }
public void BinarySerialization_Bcl() { // Skip this on Mono, which will have different BCL time zones. We can't easily // guess which will be available :( if (!TestHelper.IsRunningOnMono) { DateTimeZoneProviders.Serialization = DateTimeZoneProviders.Bcl; var zone = DateTimeZoneProviders.Bcl["Eastern Standard Time"]; var value = new ZonedDateTime(new LocalDateTime(2013, 4, 12, 17, 53, 23).WithOffset(Offset.FromHours(-4)), zone); TestHelper.AssertBinaryRoundtrip(value); } }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(LocalTime.FromHourMinuteSecondNanosecond(12, 34, 56, 123456789)); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(new LocalDateTime(2013, 4, 12, 17, 53, 23, CalendarSystem.Julian)); TestHelper.AssertBinaryRoundtrip(new LocalDateTime(2013, 4, 12, 17, 53, 23).PlusNanoseconds(123456789)); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(LocalTime.FromHourMinuteSecondMillisecondTick(12, 34, 56, 123, 4567)); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(NodaConstants.UnixEpoch.PlusNanoseconds(123456789L)); TestHelper.AssertBinaryRoundtrip(Instant.MinValue); TestHelper.AssertBinaryRoundtrip(Instant.MaxValue); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(Instant.FromUnixTimeTicks(12345L)); TestHelper.AssertBinaryRoundtrip(Instant.MinValue); TestHelper.AssertBinaryRoundtrip(Instant.MaxValue); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(Duration.FromNanoseconds(123456789L)); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(Offset.FromSeconds(12345)); TestHelper.AssertBinaryRoundtrip(Offset.FromSeconds(-12345)); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(new LocalDateTime(2013, 4, 12, 17, 53, 23, CalendarSystem.GetJulianCalendar(3))); TestHelper.AssertBinaryRoundtrip(new LocalDateTime(2013, 4, 12, 17, 53, 23, 123, 4567)); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(new Instant(12345L)); TestHelper.AssertBinaryRoundtrip(Instant.MinValue); TestHelper.AssertBinaryRoundtrip(Instant.MaxValue); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(new LocalDate(2013, 4, 12, CalendarSystem.Julian)); TestHelper.AssertBinaryRoundtrip(new LocalDate(2013, 4, 12)); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(Duration.FromTicks(12345L)); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(new LocalTime(12, 34, 56, 123, 4567)); }
public void BinarySerialization() { TestHelper.AssertBinaryRoundtrip(Instant.FromTicksSinceUnixEpoch(12345L)); TestHelper.AssertBinaryRoundtrip(Instant.MinValue); TestHelper.AssertBinaryRoundtrip(Instant.MaxValue); }