Exemple #1
0
        public void Should_convert_object_that_is_datetimeoffset_range_to_datetimeoffset_range()
        {
            var dateTimeRange = new Range <DateTimeOffset>
            {
                MinValue = new DateTimeOffset(2000, 1, 1, 0, 0, 0, TimeSpan.Zero),
                MaxValue = new DateTimeOffset(2020, 1, 1, 0, 0, 0, TimeSpan.Zero)
            } as object;

            var result = Range.AsDateRange(dateTimeRange);

            Assert.Equal(2000, result.MinValue.Value.Year);
            Assert.Equal(2020, result.MaxValue.Value.Year);
        }
Exemple #2
0
 public void Should_convert_null_to_null()
 {
     Assert.Null(Range.AsNumericRange(null));
     Assert.Null(Range.AsDateRange(null));
 }