Beispiel #1
0
        public void test_within_truncated_range_2()
        {
            //each year 2017-07-22 .. 08-12
            var start = new TruncatedDate(2017, 7, null);
            var end   = new TruncatedDate(2017, 8, null);

            var trdRange = new TruncatedDateRange(start, end);

            Assert.False(trdRange.IsWithin(new CompleteDate(2016, 7, 22)));
            Assert.True(trdRange.IsWithin(new CompleteDate(2017, 7, 1)));
            Assert.True(trdRange.IsWithin(new CompleteDate(2017, 8, 12)));
        }
Beispiel #2
0
        public void test_within_truncated_range_3()
        {
            var start = new TruncatedDate(2017, null, 12);
            var end   = new TruncatedDate(2017, null, 15);

            var trdRange = new TruncatedDateRange(start, end);

            Assert.False(trdRange.IsWithin(new CompleteDate(2017, 7, 16)));
            Assert.False(trdRange.IsWithin(new CompleteDate(2016, 7, 13)));
            Assert.True(trdRange.IsWithin(new CompleteDate(2017, 7, 15)));
            Assert.True(trdRange.IsWithin(new CompleteDate(2017, 1, 12)));
        }
Beispiel #3
0
        public void test_within_truncated_range_1()
        {
            //each year 07-22 .. 08-12
            var start = new TruncatedDate(null, 7, 22);
            var end   = new TruncatedDate(null, 8, 12);

            var trdRange = new TruncatedDateRange(start, end);

            Assert.True(trdRange.IsWithin(new CompleteDate(1730, 7, 22)));
            Assert.True(trdRange.IsWithin(new CompleteDate(1730, 7, 31)));
            Assert.True(trdRange.IsWithin(new CompleteDate(1730, 8, 12)));

            Assert.False(trdRange.IsWithin(new CompleteDate(1730, 7, 21)));
            Assert.False(trdRange.IsWithin(new CompleteDate(2017, 7, 21)));
        }