public void FromUnixTimeMilliseconds_Range() { long smallestValid = Instant.MinValue.ToUnixTimeTicks() / NodaConstants.TicksPerMillisecond; long largestValid = Instant.MaxValue.ToUnixTimeTicks() / NodaConstants.TicksPerMillisecond; TestHelper.AssertValid(Instant.FromUnixTimeMilliseconds, smallestValid); TestHelper.AssertOutOfRange(Instant.FromUnixTimeMilliseconds, smallestValid - 1); TestHelper.AssertValid(Instant.FromUnixTimeMilliseconds, largestValid); TestHelper.AssertOutOfRange(Instant.FromUnixTimeMilliseconds, largestValid + 1); }
public void FromTicksSinceUnixEpoch_Range() { long smallestValid = Instant.MinValue.ToUnixTimeTicks(); long largestValid = Instant.MaxValue.ToUnixTimeTicks(); TestHelper.AssertValid(Instant.FromUnixTimeTicks, smallestValid); TestHelper.AssertOutOfRange(Instant.FromUnixTimeTicks, smallestValid - 1); TestHelper.AssertValid(Instant.FromUnixTimeTicks, largestValid); TestHelper.AssertOutOfRange(Instant.FromUnixTimeTicks, largestValid + 1); }
public void GetAbsoluteYear_ValidBce(int year) { TestHelper.AssertValid(Iso.GetAbsoluteYear, year, Era.BeforeCommon); }
public void IsLeapYear_Valid(int year) { TestHelper.AssertValid(Iso.IsLeapYear, year); }
public void GetDaysInMonth_Hebrew() { TestHelper.AssertValid(CalendarSystem.HebrewCivil.GetDaysInMonth, 5402, 13); // Leap year TestHelper.AssertOutOfRange(CalendarSystem.HebrewCivil.GetDaysInMonth, 5401, 13); // Not a leap year }
public void GetDaysInMonth_Valid(int year, int month) { TestHelper.AssertValid(Iso.GetDaysInMonth, year, month); }
public void GetMonthsInYear_Valid(int year) { TestHelper.AssertValid(Iso.GetMonthsInYear, year); }