A combination of conjunction and disjunction queries.
Inheritance: FtsQueryBase
        public void Export_ReturnsValidJson()
        {
            var query = new BooleanQuery();
            query.Must(new TermQuery("hotel").Field("type"));

            var result = query.Export().ToString(Formatting.None);

            var expected = JsonConvert.SerializeObject(new
            {
                query = new
                {
                    boost = 0.0,
                    must = new[]
                    {
                        new
                        {
                            query = new
                            {
                                term = "hotel",
                                boost = 0.0,
                                field = "type",
                                prefix_length = 0,
                                fuzziness = 0
                            }
                        }
                    },
                    must_not = new dynamic[] {},
                    should = new dynamic[] {}
                }
            }, Formatting.None);

            Assert.AreEqual(expected, result);
        }
        public void Throws_InvalidOperationException_When_No_Sub_Queries()
        {
            var query = new BooleanQuery();

            Assert.Throws<InvalidOperationException>(() => query.Export());
            Assert.Throws<InvalidOperationException>(() => query.Export(new SearchParams()));
        }
        public void Export_Returns_Valid_Json_For_MustNot()
        {
            var query = new BooleanQuery();
            query.MustNot(new TermQuery("hotel").Field("type"));

            var result = query.Export().ToString(Formatting.None);

            var expected = JsonConvert.SerializeObject(new
            {
                must_not = new
                {
                    min = 1,
                    disjuncts = new dynamic[]
                    {
                        new
                        {
                            term = "hotel",
                            prefix_length = 0,
                            fuzziness = 0,
                            field = "type"
                        }
                    }
                }
            }, Formatting.None);

            Assert.AreEqual(expected, result);
        }
        public void Can_Execute_Query_With_Only_One_Type_Of_Sub_Query()
        {
            var query = new BooleanQuery();
            query.Must(new TermQuery("hotel").Field("type"));

            var result = query.Export();

            Assert.IsNotNull(result);
        }
        public void Boost_WhenBoostIsLessThanZero_ThrowsArgumentOutOfRangeException()
        {
            var query = new BooleanQuery();

            Assert.Throws<ArgumentOutOfRangeException>(() => query.Boost(-.1));
        }
        public void Boost_ReturnsBooleanQuery()
        {
            var query = new BooleanQuery().Boost(2.2);

            Assert.IsInstanceOf<BooleanQuery>(query);
        }