Example #1
0
 public void InvalidBinaryData(Type expectedExceptionType, int year, int month, int day, int calendarOrdinal) =>
 TestHelper.AssertBinaryDeserializationFailure <LocalDate>(expectedExceptionType, info =>
 {
     info.AddValue(BinaryFormattingConstants.YearSerializationName, year);
     info.AddValue(BinaryFormattingConstants.MonthSerializationName, month);
     info.AddValue(BinaryFormattingConstants.DaySerializationName, day);
     info.AddValue(BinaryFormattingConstants.CalendarSerializationName, calendarOrdinal);
 });
Example #2
0
 [TestCase(typeof(ArgumentException), 0, 0L, -1, 0L)] // End before start
 public void InvalidBinaryData(Type expectedExceptionType, int startDays, long startNanoOfDay, int endDays, long endNanoOfDay) =>
 TestHelper.AssertBinaryDeserializationFailure <Interval>(expectedExceptionType, info =>
 {
     info.AddValue(BinaryFormattingConstants.PresenceName, 3);
     info.AddValue(BinaryFormattingConstants.StartDaysSerializationName, startDays);
     info.AddValue(BinaryFormattingConstants.StartNanosecondOfDaySerializationName, startNanoOfDay);
     info.AddValue(BinaryFormattingConstants.EndDaysSerializationName, endDays);
     info.AddValue(BinaryFormattingConstants.EndNanosecondOfDaySerializationName, endNanoOfDay);
 });
Example #3
0
 public void InvalidBinaryData(Type expectedExceptionType, int year, int month, int day, long nanosecondOfDay, int calendarOrdinal, int offsetSeconds, string zoneId)
 {
     DateTimeZoneProviders.Serialization = DateTimeZoneProviders.Tzdb;
     TestHelper.AssertBinaryDeserializationFailure <ZonedDateTime>(expectedExceptionType, info =>
     {
         info.AddValue(BinaryFormattingConstants.YearSerializationName, year);
         info.AddValue(BinaryFormattingConstants.MonthSerializationName, month);
         info.AddValue(BinaryFormattingConstants.DaySerializationName, day);
         info.AddValue(BinaryFormattingConstants.NanoOfDaySerializationName, nanosecondOfDay);
         info.AddValue(BinaryFormattingConstants.CalendarSerializationName, calendarOrdinal);
         info.AddValue(BinaryFormattingConstants.OffsetSecondsSerializationName, offsetSeconds);
         info.AddValue(BinaryFormattingConstants.ZoneIdSerializationName, zoneId);
     });
 }
Example #4
0
 public void InvalidBinaryData(Type expectedExceptionType, long nanoOfDay) =>
 TestHelper.AssertBinaryDeserializationFailure <LocalTime>(expectedExceptionType, info =>
 {
     info.AddValue(BinaryFormattingConstants.NanoOfDaySerializationName, nanoOfDay);
 });
 public void InvalidBinaryData(Type expectedExceptionType, int days, long nanoOfDay) =>
 TestHelper.AssertBinaryDeserializationFailure <Duration>(expectedExceptionType, info =>
 {
     info.AddValue(BinaryFormattingConstants.DurationDefaultDaysSerializationName, days);
     info.AddValue(BinaryFormattingConstants.DurationDefaultNanosecondOfDaySerializationName, nanoOfDay);
 });
Example #6
0
 public void InvalidBinaryData(Type expectedExceptionType, int seconds) =>
 TestHelper.AssertBinaryDeserializationFailure <Offset>(expectedExceptionType, info =>
 {
     info.AddValue(BinaryFormattingConstants.OffsetSecondsSerializationName, seconds);
 });