Example #1
0
        public async void should_filter_on_date_range()
        {
            var start  = new DateTime(2000, 1, 1);
            var end    = new DateTime(2015, 1, 1);
            var result = await Subject.Search(null, 0, 10, DateRangeFilter.Between(x => x.CreateTime, start, end));

            result.Data.Should().NotContain(x => x.CreateTime <start || x.CreateTime> end);
            result.Data.Should().Contain(x => x.CreateTime > start && x.CreateTime < end);
        }
Example #2
0
        public async void should_filter_on_alt_custom_data_with_conflicting_names()
        {
            var result1 = await Subject.Search(null, 0, 10, ScalarFilter.Equals <AltDataObject>(x => x.Value1, 9));

            var result2 = await Subject.Search(null, 0, 10, DateRangeFilter.Between <AltDataObject>(x => x.Value2, new DateTime(1999, 12, 31), new DateTime(2000, 1, 2)));

            result1.Data.Should().Contain(x => x.Id == "4");
            result2.Data.Should().Contain(x => x.Id == "4");
        }