public void test_query_write_with_querybuilder_with_documentType_with_unknowName()
        {
            var query   = new StringQuery("Name", "unknowNamemyff");
            var query2  = new StringQuery("Content", "unknowNamemyff");
            var orQuery = new OrQuery(query, query2, OccurType.Must);

            orQuery.Next(new StringQuery("DocumentType", DocumentType.Excel.ToString(), OccurType.Must));
            var results = _provider.Query <DocumentSearchResult>(orQuery);

            Assert.AreEqual(results.Count, 0);
        }
        public void test_write_documents_with_query_condition_with_different_documentType()
        {
            var query   = new StringQuery("Name", "报价明细表", OccurType.Should);
            var query2  = new StringQuery("Content", "报价明细表", OccurType.Should);
            var orQuery = new OrQuery(query, query2, OccurType.Must);

            orQuery.Next(new StringQuery("DocumentType", DocumentType.Word.ToString(), OccurType.Must));

            var results = _provider.Query <DocumentSearchResult>(orQuery);

            Assert.AreEqual(results.Count, 0);
        }
        public void test_write_documents_with_query_condition_with_all_query_empty()
        {
            var query  = new StringQuery(string.Empty, string.Empty, OccurType.Should);
            var query2 = new StringQuery(string.Empty, string.Empty, OccurType.Should);

            var orQuery = new OrQuery(query, query2, OccurType.Must);

            orQuery.Next(new StringQuery(string.Empty, string.Empty, OccurType.Must));

            var results = _provider.Query <DocumentSearchResult>(orQuery);

            Assert.AreEqual(results.Count, 0);
        }
Exemple #4
0
        public void test_write_documents_with_query_condition_with_correct_name()
        {
            WriteSpace("spaces");

            var query   = new StringQuery("Name", "空间", OccurType.Should);
            var query2  = new StringQuery("Content", "空间", OccurType.Should);
            var orQuery = new OrQuery(query, query2, OccurType.Must);

            orQuery.Next(new StringQuery("DocumentType", DocumentType.Folder.ToString(), OccurType.Must));
            var results = _provider.Query <DocumentSearchResult>(orQuery);

            Assert.AreEqual(results.Count, 2);
        }