コード例 #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
ファイル: OffsetTimeTest.cs プロジェクト: vinayv1234/nodatime
        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
ファイル: PeriodTest.cs プロジェクト: ferkopar/FerkopaUtils
 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
ファイル: OffsetTest.cs プロジェクト: tuga1975/nodatime
 public void BinarySerialization()
 {
     TestHelper.AssertBinaryRoundtrip(Offset.FromSeconds(12345));
     TestHelper.AssertBinaryRoundtrip(Offset.FromSeconds(-12345));
 }
コード例 #17
0
 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
ファイル: DurationTest.cs プロジェクト: cata/nodatime
 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);
 }