Example #1
0
        public void AndFilterTestOutput()
        {
            var andFilter = FilterFactory.AndFilter(FilterFactory.TermFilter("name.first", "shay1"), FilterFactory.TermFilter("name.first", "shay4"));
            var filter = new FilteredQueryBuilder(QueryFactory.TermQuery("name.first", "shay"), andFilter);

            this.JsonEquals(filter.ToJsonObject(), MethodInfo.GetCurrentMethod(), "and-filter");
        }
Example #2
0
        public void AndFilterTestOutput()
        {
            var andFilter = FilterFactory.AndFilter(FilterFactory.TermFilter("name.first", "shay1"), FilterFactory.TermFilter("name.first", "shay4"));
            var filter    = new FilteredQueryBuilder(QueryFactory.TermQuery("name.first", "shay"), andFilter);

            this.JsonEquals(filter.ToJsonObject(), MethodInfo.GetCurrentMethod(), "and-filter");
        }
Example #3
0
        public void AndFilterTestOutput()
        {
            var andFilter = FilterFactory.AndFilter(FilterFactory.TermFilter("name.first", "shay1"), FilterFactory.TermFilter("name.first", "shay4"));
            var filter    = new FilteredQueryBuilder(QueryFactory.TermQuery("name.first", "shay"), andFilter);

            Assert.AreEqual(File.ReadAllText("DSL/Filter/and-filter.json").Strip(), filter.ToJsonObject().Strip());
        }
Example #4
0
        public void BoolFilterTestOutput()
        {
            var boolFilter = FilterFactory.BoolFilter();
            boolFilter.Must(FilterFactory.TermFilter("name.first", "shay1"));
            boolFilter.Must(FilterFactory.TermFilter("name.first", "shay4"));
            boolFilter.MustNot(FilterFactory.TermFilter("name.first", "shay2"));
            boolFilter.Should(FilterFactory.TermFilter("name.first", "shay3"));

            var filter = new FilteredQueryBuilder(QueryFactory.TermQuery("name.first", "shay"), boolFilter);

            this.JsonEquals(filter.ToJsonObject(), MethodInfo.GetCurrentMethod(), "bool-filter");
        }
Example #5
0
        public void BoolFilterTestOutput()
        {
            var boolFilter = FilterFactory.BoolFilter();

            boolFilter.Must(FilterFactory.TermFilter("name.first", "shay1"));
            boolFilter.Must(FilterFactory.TermFilter("name.first", "shay4"));
            boolFilter.MustNot(FilterFactory.TermFilter("name.first", "shay2"));
            boolFilter.Should(FilterFactory.TermFilter("name.first", "shay3"));

            var filter = new FilteredQueryBuilder(QueryFactory.TermQuery("name.first", "shay"), boolFilter);

            this.JsonEquals(filter.ToJsonObject(), MethodInfo.GetCurrentMethod(), "bool-filter");
        }
Example #6
0
        public void BoolFilterTestOutput()
        {
            var boolFilter = FilterFactory.BoolFilter();

            boolFilter.Must(FilterFactory.TermFilter("name.first", "shay1"));
            boolFilter.Must(FilterFactory.TermFilter("name.first", "shay4"));
            boolFilter.MustNot(FilterFactory.TermFilter("name.first", "shay2"));
            boolFilter.Should(FilterFactory.TermFilter("name.first", "shay3"));

            var filter = new FilteredQueryBuilder(QueryFactory.TermQuery("name.first", "shay"), boolFilter);

            Assert.AreEqual(File.ReadAllText("DSL/Filter/bool-filter.json").Strip(), filter.ToJsonObject().Strip());
        }
Example #7
0
        public void TermFilterTestOutput()
        {
            var filter = new FilteredQueryBuilder(QueryFactory.TermQuery("name.first", "shay"), FilterFactory.TermFilter("name.last", "banon"));

            this.JsonEquals(filter.ToJsonObject(), MethodInfo.GetCurrentMethod(), "filtered-query");
        }
Example #8
0
        public void TermFilterTestOutput()
        {
            var filter = new FilteredQueryBuilder(QueryFactory.TermQuery("name.first", "shay"), FilterFactory.TermFilter("name.last","banon"));

            this.JsonEquals(filter.ToJsonObject(), MethodInfo.GetCurrentMethod(), "filtered-query");
        }
Example #9
0
        public void TermFilterTestOutput()
        {
            var filter = new FilteredQueryBuilder(QueryFactory.TermQuery("name.first", "shay"), FilterFactory.TermFilter("name.last", "banon"));

            Assert.AreEqual(File.ReadAllText("DSL/Filter/filtered-query.json").Strip(), filter.ToJsonObject().Strip());
        }