Пример #1
0
        public void ToDateTimeUtc_ThenToInstant_ReturnsSameValue(Instant expected)
        {
            var dateTime = NodaTimeConverter.ToDateTimeUtc(expected);
            var actual   = NodaTimeConverter.UtcDateTimeToInstant(dateTime);

            Assert.That(actual, Is.EqualTo(expected));
        }
Пример #2
0
 public void ToDateTimeUtc_ConvertsMaxInstantToMaxDateTimeUtc()
 {
     Assert.That(NodaTimeConverter.ToDateTimeUtc(Instant.MaxValue), Is.EqualTo(MaxDateTimeUtc));
 }
Пример #3
0
 public void ToDateTimeUtc_WithValuesOutsideOfRange_Throws(Instant input)
 {
     Assert.That(() => NodaTimeConverter.ToDateTimeUtc(input), Throws.TypeOf <ArgumentOutOfRangeException>());
 }
Пример #4
0
 public void ToDateTimeUtc_ConvertsDateTimeCorrectly()
 {
     Assert.That(NodaTimeConverter.ToDateTimeUtc(Instant0101), Is.EqualTo(DateTimeUtc0101));
 }