Exemple #1
0
        public void ApplyToQuery_InRangeDate_CorrectResultReturned()
        {
            var criteria = new DateSearch();

            criteria.Property       = "Date";
            criteria.TargetTypeName = typeof(SomeClass).AssemblyQualifiedName;

            criteria.SearchTerm  = new System.DateTime(2001, 2, 1);
            criteria.SearchTerm2 = new System.DateTime(2006, 7, 1);
            criteria.Comparator  = DateComparators.InRange;

            Assert.AreEqual(12, criteria.ApplyToQuery(new Repository().GetQuery()).Count());
        }
Exemple #2
0
        public void ApplyToQuery_LessOrEqualDateNullable_CorrectResultReturned()
        {
            var criteria = new DateSearch();

            criteria.Property       = "DateNullable";
            criteria.TargetTypeName = typeof(SomeClass).AssemblyQualifiedName;

            criteria.SearchTerm  = new System.DateTime(2007, 8, 1);
            criteria.SearchTerm2 = null;
            criteria.Comparator  = DateComparators.LessOrEqual;

            Assert.AreEqual(8, criteria.ApplyToQuery(new Repository().GetQuery()).Count());
        }