Exemplo n.º 1
0
 public void Parse2() {
     var parser = new CollapseResponseParser<TestDoc>();
     var xml = EmbeddedResource.GetEmbeddedXml(GetType(), "Resources.collapseResponse2.xml");
     var results = new SolrQueryResults<TestDoc>();
     parser.Parse(xml, results);
     Assert.IsNotNull(results.Collapsing);
     Assert.AreEqual("manu_exact", results.Collapsing.Field);
     Assert.AreEqual(3, results.Collapsing.CollapsedDocuments.Count);
     var firstCollapse = results.Collapsing.CollapsedDocuments.ElementAt(0);
     Assert.AreEqual("F8V7067-APL-KIT", firstCollapse.Id);
     Assert.AreEqual(1, firstCollapse.CollapseCount);
     Assert.AreEqual("Belkin", firstCollapse.FieldValue);
 }
Exemplo n.º 2
0
        public void Parse2()
        {
            var parser  = new CollapseResponseParser <TestDoc>();
            var xml     = EmbeddedResource.GetEmbeddedXml(GetType(), "Resources.collapseResponse2.xml");
            var results = new SolrQueryResults <TestDoc>();

            parser.Parse(xml, results);
            Assert.IsNotNull(results.Collapsing);
            Assert.AreEqual("manu_exact", results.Collapsing.Field);
            Assert.AreEqual(3, results.Collapsing.CollapsedDocuments.Count);
            var firstCollapse = results.Collapsing.CollapsedDocuments.ElementAt(0);

            Assert.AreEqual("F8V7067-APL-KIT", firstCollapse.Id);
            Assert.AreEqual(1, firstCollapse.CollapseCount);
            Assert.AreEqual("Belkin", firstCollapse.FieldValue);
        }