示例#1
0
 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));
 }
示例#2
0
 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)));
 }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
 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));
 }
示例#8
0
 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));
 }
示例#9
0
 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);
     }
 }
示例#10
0
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(LocalTime.FromHourMinuteSecondNanosecond(12, 34, 56, 123456789));
 }
示例#11
0
 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));
 }
示例#12
0
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(LocalTime.FromHourMinuteSecondMillisecondTick(12, 34, 56, 123, 4567));
 }
示例#13
0
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(NodaConstants.UnixEpoch.PlusNanoseconds(123456789L));
     TestHelper.AssertBinaryRoundtrip(Instant.MinValue);
     TestHelper.AssertBinaryRoundtrip(Instant.MaxValue);
 }
示例#14
0
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(Instant.FromUnixTimeTicks(12345L));
     TestHelper.AssertBinaryRoundtrip(Instant.MinValue);
     TestHelper.AssertBinaryRoundtrip(Instant.MaxValue);
 }
示例#15
0
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(Duration.FromNanoseconds(123456789L));
 }
示例#16
0
 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));
 }
示例#18
0
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(new Instant(12345L));
     TestHelper.AssertBinaryRoundtrip(Instant.MinValue);
     TestHelper.AssertBinaryRoundtrip(Instant.MaxValue);
 }
示例#19
0
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(new LocalDate(2013, 4, 12, CalendarSystem.Julian));
     TestHelper.AssertBinaryRoundtrip(new LocalDate(2013, 4, 12));
 }
示例#20
0
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(Duration.FromTicks(12345L));
 }
示例#21
0
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(new LocalTime(12, 34, 56, 123, 4567));
 }
示例#22
0
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(Instant.FromTicksSinceUnixEpoch(12345L));
     TestHelper.AssertBinaryRoundtrip(Instant.MinValue);
     TestHelper.AssertBinaryRoundtrip(Instant.MaxValue);
 }