Beispiel #1
0
        public void DeleteByQuery()
        {
            var mocks           = new MockRepository();
            var connection      = mocks.StrictMock <ISolrConnection>();
            var headerParser    = mocks.StrictMock <ISolrHeaderResponseParser>();
            var executer        = mocks.StrictMock <ISolrQueryExecuter <TestDocumentWithUniqueKey> >();
            var docSerializer   = mocks.StrictMock <ISolrDocumentSerializer <TestDocumentWithUniqueKey> >();
            var querySerializer = mocks.StrictMock <ISolrQuerySerializer>();

            With.Mocks(mocks)
            .Expecting(() => {
                Expect.On(querySerializer)
                .Call(querySerializer.Serialize(null))
                .IgnoreArguments()
                .Return("id:123");
                Expect.On(connection)
                .Call(connection.Post("/update", "<delete><query>id:123</query></delete>"))
                .Repeat.Once()
                .Return(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));
                Expect.On(headerParser)
                .Call(headerParser.Parse(null))
                .IgnoreArguments()
                .Return(new ResponseHeader());
            })
            .Verify(() => {
                var ops = new SolrBasicServer <TestDocumentWithUniqueKey>(connection, executer, docSerializer, null, headerParser, querySerializer, null, null);
                ops.Delete(null, new SolrQuery("id:123"));
            });
        }
Beispiel #2
0
        public void QueryWithPagination()
        {
            const string qstring    = "id:123";
            const int    start      = 10;
            const int    rows       = 20;
            var          connection = new MSolrConnection();

            connection.get += (url, param) => {
                Assert.AreEqual("/select", url);
                var expectedParams = new Dictionary <string, string> {
                    { "q", qstring },
                    { "start", start.ToString() },
                    { "rows", rows.ToString() },
                };
                CollectionAssert.AreEquivalent(expectedParams, param);
                return(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));
            };

            var querySerializer = new MSolrQuerySerializer();

            querySerializer.serialize += _ => qstring;

            var resultParser = new MSolrAbstractResponseParser <TestDocumentWithUniqueKey>();

            resultParser.parse &= x => x.Stub();

            var executer = new SolrQueryExecuter <TestDocumentWithUniqueKey>(resultParser, connection, querySerializer, null, null);
            var solr     = new SolrBasicServer <TestDocumentWithUniqueKey>(connection, executer, null, null, null, null, null, null);
            var r        = solr.Query(new SolrQuery(qstring), new QueryOptions {
                Start = start, Rows = rows
            });

            Assert.AreEqual(1, connection.get.Calls);
        }
Beispiel #3
0
        public void ParseHighlighting2WrappedWithClass()
        {
            var highlights = ParseHighlightingResults(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithHighlighting2.xml"));
            var first      = highlights.First();

            Assert.AreEqual(3, first.Value.Snippets["source_en"].Count);
        }
Beispiel #4
0
        public void AddWithParameters()
        {
            var mocks         = new MockRepository();
            var connection    = mocks.StrictMock <ISolrConnection>();
            var executer      = mocks.StrictMock <ISolrQueryExecuter <TestDocumentWithoutUniqueKey> >();
            var headerParser  = mocks.StrictMock <ISolrHeaderResponseParser>();
            var docSerializer = new SolrDocumentSerializer <TestDocumentWithoutUniqueKey>(new AttributesMappingManager(), new DefaultFieldSerializer());

            With.Mocks(mocks)
            .Expecting(() => {
                Expect.On(connection)
                .Call(connection.Post("/update", "<add commitWithin=\"4343\" overwrite=\"false\"><doc /></add>"))
                .Repeat.Once()
                .Return(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));
                Expect.On(headerParser)
                .Call(headerParser.Parse(null))
                .IgnoreArguments()
                .Return(new ResponseHeader());
            })
            .Verify(() => {
                var ops        = new SolrBasicServer <TestDocumentWithoutUniqueKey>(connection, executer, docSerializer, null, headerParser, null, null, null);
                var parameters = new AddParameters {
                    CommitWithin = 4343, Overwrite = false
                };
                ops.AddWithBoost(new[] { new KeyValuePair <TestDocumentWithoutUniqueKey, double?>(new TestDocumentWithoutUniqueKey(), null), }, parameters);
            });
        }
Beispiel #5
0
        public void Extract()
        {
            var mocks                 = new MockRepository();
            var connection            = mocks.StrictMock <ISolrConnection>();
            var executer              = mocks.StrictMock <ISolrQueryExecuter <TestDocumentWithoutUniqueKey> >();
            var headerParser          = mocks.StrictMock <ISolrHeaderResponseParser>();
            var extractResponseParser = mocks.StrictMock <ISolrExtractResponseParser>();
            var docSerializer         = new SolrDocumentSerializer <TestDocumentWithoutUniqueKey>(new AttributesMappingManager(), new DefaultFieldSerializer());
            var parameters            = new ExtractParameters(null, "1", "test.doc");

            With.Mocks(mocks)
            .Expecting(() => {
                Expect.On(connection)
                .Call(connection.PostStream("/update/extract", null, parameters.Content, new List <KeyValuePair <string, string> > {
                    new KeyValuePair <string, string>("literal.id", parameters.Id),
                    new KeyValuePair <string, string>("resource.name", parameters.ResourceName),
                }))
                .Repeat.Once()
                .Return(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithExtractContent.xml"));
                Expect.On(extractResponseParser)
                .Call(extractResponseParser.Parse(null))
                .IgnoreArguments()
                .Return(new ExtractResponse(null));
            })
            .Verify(() => {
                var ops = new SolrBasicServer <TestDocumentWithoutUniqueKey>(connection, executer, docSerializer, null, headerParser, null, null, extractResponseParser);
                ops.Extract(parameters);
            });
        }
Beispiel #6
0
        public void CommitWithOptions2_WaitFlush()
        {
            var mocks         = new MockRepository();
            var connection    = mocks.StrictMock <ISolrConnection>();
            var headerParser  = mocks.StrictMock <ISolrHeaderResponseParser>();
            var executer      = mocks.StrictMock <ISolrQueryExecuter <TestDocumentWithoutUniqueKey> >();
            var docSerializer = mocks.StrictMock <ISolrDocumentSerializer <TestDocumentWithoutUniqueKey> >();

            With.Mocks(mocks)
            .Expecting(() => {
                Expect.On(connection)
                .Call(connection.Post("/update", "<commit waitSearcher=\"true\" waitFlush=\"true\" />"))
                .Repeat.Once()
                .Return(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));
                Expect.On(headerParser)
                .Call(headerParser.Parse(null))
                .IgnoreArguments()
                .Return(new ResponseHeader());
            })
            .Verify(() => {
                var ops = new SolrBasicServer <TestDocumentWithoutUniqueKey>(connection, executer, docSerializer, null, headerParser, null, null, null);
                ops.Commit(new CommitOptions {
                    WaitFlush = true
                });
            });
        }
Beispiel #7
0
        public void AtomicUpdate()
        {
            var xml        = EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml");
            var connection = new MSolrConnection();

            connection.postStream += new MFunc <string, string, Stream, IEnumerable <KeyValuePair <string, string> >, string>((url, contentType, content, param) => {
                string text = new StreamReader(content, Encoding.UTF8).ReadToEnd();
                Assert.Equal("/update", url);
                Assert.Equal("commitWithin", ((KeyValuePair <string, string>[])param)[0].Key);
                Assert.Equal("4343", ((KeyValuePair <string, string>[])param)[0].Value);
                Assert.Equal("[{\"id\":\"0\",\"animal\":{\"set\":\"squirrel\"},\"food\":{\"add\":[\"nuts\",\"seeds\"]},\"count\":{\"inc\":3},\"colour\":{\"remove\":\"pink\"},\"habitat\":{\"removeregex\":[\"tree.*\",\"river.+\"]}}]", text);
                return(xml);
            });
            var headerParser = new MSolrHeaderResponseParser();

            headerParser.parse += _ => null;
            var basic      = new SolrBasicServer <TestDocumentWithUniqueKey>(connection, null, null, null, headerParser, null, null, null);
            var ops        = new SolrServer <TestDocumentWithUniqueKey>(basic, new AttributesMappingManager(), null);
            var parameters = new AtomicUpdateParameters {
                CommitWithin = 4343
            };
            var updateSpecs = new AtomicUpdateSpec[] { new AtomicUpdateSpec("animal", AtomicUpdateType.Set, "squirrel"),
                                                       new AtomicUpdateSpec("food", AtomicUpdateType.Add, new string[] { "nuts", "seeds" }), new AtomicUpdateSpec("count", AtomicUpdateType.Inc, 3),
                                                       new AtomicUpdateSpec("colour", AtomicUpdateType.Remove, "pink"), new AtomicUpdateSpec("habitat", AtomicUpdateType.RemoveRegex, new string[] { "tree.*", "river.+" }) };

            ops.AtomicUpdate(new TestDocumentWithUniqueKey(), updateSpecs, parameters);
            Assert.Equal(1, connection.postStream.Calls);
        }
Beispiel #8
0
        public void FacetQuery()
        {
            var connection = new MSolrConnection();

            connection.get += (url, param) => {
                Assert.AreEqual("/select", url);
                var expectedParams = new Dictionary <string, string> {
                    { "q", "" },
                    { "rows", SolrQueryExecuter <TestDocumentWithUniqueKey> .ConstDefaultRows.ToString() },
                    { "facet", "true" },
                    { "facet.query", "id:1" },
                };
                CollectionAssert.AreEquivalent(expectedParams, param);
                return(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));
            };

            var querySerializer      = new DefaultQuerySerializer(new DefaultFieldSerializer());
            var facetQuerySerializer = new DefaultFacetQuerySerializer(querySerializer, new DefaultFieldSerializer());
            var parser = new MSolrAbstractResponseParser <TestDocumentWithUniqueKey>();

            parser.parse &= x => x.Stub();
            var executer = new SolrQueryExecuter <TestDocumentWithUniqueKey>(parser, connection, querySerializer, facetQuerySerializer, null);
            var solr     = new SolrBasicServer <TestDocumentWithUniqueKey>(connection, executer, null, null, null, null, null, null);
            var r        = solr.Query(new SolrQuery(""), new QueryOptions {
                Facet = new FacetParameters {
                    Queries = new ISolrFacetQuery[] {
                        new SolrFacetQuery(new SolrQuery("id:1")),
                    },
                }
            });

            Assert.AreEqual(1, connection.get.Calls);
        }
Beispiel #9
0
        public void NullableDateTime()
        {
            var    mocks             = new MockRepository();
            var    connection        = mocks.StrictMock <ISolrConnection>();
            var    responseParser    = mocks.DynamicMock <ISolrHeaderResponseParser>();
            var    resultParser      = mocks.StrictMock <ISolrQueryResultParser <TestDocWithNullable> >();
            var    queryExecuter     = new SolrQueryExecuter <TestDocWithNullable>(resultParser, connection, null, null);
            var    mapper            = new AttributesMappingManager();
            var    docSerializer     = new SolrDocumentSerializer <TestDocWithNullable>(mapper, new DefaultFieldSerializer());
            var    validationManager = mocks.StrictMock <IMappingValidator>();
            var    basicSolr         = new SolrBasicServer <TestDocWithNullable>(connection, queryExecuter, docSerializer, null, responseParser, null, null, null);
            var    solr = new SolrServer <TestDocWithNullable>(basicSolr, mapper, validationManager);
            string xml  = null;

            With.Mocks(mocks)
            .Expecting(() => {
                Expect.On(connection)
                .Call(connection.Post(null, null))
                .IgnoreArguments()
                .Do(new Writer(delegate(string u, string s) {
                    Console.WriteLine(s);
                    xml = s;
                    return(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));
                }));
            })
            .Verify(() => {
                solr.Add(new TestDocWithNullable());
                Assert.AreEqual("<add><doc /></add>", xml);
            });
        }
Beispiel #10
0
        public void DeleteByMultipleId()
        {
            var mocks             = new MockRepository();
            var connection        = mocks.StrictMock <ISolrConnection>();
            var headerParser      = mocks.StrictMock <ISolrHeaderResponseParser>();
            var executer          = mocks.StrictMock <ISolrQueryExecuter <TestDocumentWithUniqueKey> >();
            var docSerializer     = mocks.StrictMock <ISolrDocumentSerializer <TestDocumentWithUniqueKey> >();
            var validationManager = mocks.StrictMock <IMappingValidator>();

            With.Mocks(mocks)
            .Expecting(() => {
                Expect.On(connection)
                .Call(connection.Post("/update", "<delete><id>0</id><id>0</id></delete>"))
                .Repeat.Once()
                .Return(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));
                Expect.On(headerParser)
                .Call(headerParser.Parse(null))
                .IgnoreArguments()
                .Return(new ResponseHeader());
            })
            .Verify(() => {
                var basic = new SolrBasicServer <TestDocumentWithUniqueKey>(connection, executer, docSerializer, null, headerParser, null, null, null);
                var ops   = new SolrServer <TestDocumentWithUniqueKey>(basic, new AttributesMappingManager(), validationManager);
                ops.Delete(new[] {
                    new TestDocumentWithUniqueKey(),
                    new TestDocumentWithUniqueKey(),
                });
            });
        }
        public void NumFound()
        {
            var docParser   = GetDocumentParser <TestDocument>();
            var innerParser = new ResultsResponseParser <TestDocument>(docParser);
            var parser      = new SolrQueryResultParser <TestDocument>(new[] { innerParser });
            var r           = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));

            Assert.AreEqual(1, r.NumFound);
        }
        public void ReadMaxScore_doesnt_crash_if_not_present()
        {
            var docParser   = GetDocumentParser <TestDocument>();
            var innerParser = new ResultsResponseParser <TestDocument>(docParser);
            var parser      = new SolrQueryResultParser <TestDocument>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));

            Assert.IsNull(results.MaxScore);
        }
        public void ReadsMaxScoreAttribute()
        {
            var docParser   = GetDocumentParser <TestDocumentWithArrays4>();
            var innerParser = new ResultsResponseParser <TestDocumentWithArrays4>(docParser);
            var parser      = new SolrQueryResultParser <TestDocumentWithArrays4>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithArraysSimple.xml"));

            Assert.AreEqual(1.6578954, results.MaxScore);
        }
        public void ReadsMaxScoreAttribute()
        {
            var mapper      = new AttributesMappingManager();
            var innerParser = new ResultsResponseParser <TestDocumentWithArrays4>(new SolrDocumentResponseParser <TestDocumentWithArrays4>(mapper, new DefaultDocumentVisitor(mapper, new DefaultFieldParser()), new SolrDocumentActivator <TestDocumentWithArrays4>()));
            var parser      = new SolrQueryResultParser <TestDocumentWithArrays4>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithArraysSimple.xml"));

            Assert.AreEqual(1.6578954, results.MaxScore);
        }
        public void ReadMaxScore_doesnt_crash_if_not_present()
        {
            var mapper      = new AttributesMappingManager();
            var innerParser = new ResultsResponseParser <TestDocument>(new SolrDocumentResponseParser <TestDocument>(mapper, new DefaultDocumentVisitor(mapper, new DefaultFieldParser()), new SolrDocumentActivator <TestDocument>()));
            var parser      = new SolrQueryResultParser <TestDocument>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));

            Assert.IsNull(results.MaxScore);
        }
Beispiel #16
0
        public void ParseHighlighting3()
        {
            var highlights = ParseHighlightingResults(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithHighlighting3.xml"));

            Assert.AreEqual(0, highlights["e4420cc2"].Count);
            Assert.AreEqual(1, highlights["e442c4cd"].Count);
            Assert.AreEqual(1, highlights["e442c4cd"]["bodytext"].Count);
            Assert.Contains(highlights["e442c4cd"]["bodytext"].First(), "Garia lancerer");
        }
        public void ParseHighlighting2()
        {
            var highlights = ParseHighlightingResults(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithHighlighting2.xml"));
            var first      = highlights.First();

            first.Value.Keys.ToList().ForEach(Console.WriteLine);
            first.Value["source_en"].ToList().ForEach(Console.WriteLine);
            Assert.AreEqual(3, first.Value["source_en"].Count);
        }
        public void NumFound()
        {
            var mapper      = new AttributesMappingManager();
            var innerParser = new ResultsResponseParser <TestDocument>(new SolrDocumentResponseParser <TestDocument>(mapper, new DefaultDocumentVisitor(mapper, new DefaultFieldParser()), new SolrDocumentActivator <TestDocument>()));
            var parser      = new SolrQueryResultParser <TestDocument>(new[] { innerParser });
            var r           = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));

            Assert.AreEqual(1, r.NumFound);
        }
        public void WrongFieldDoesntThrow()
        {
            var mapper      = new AttributesMappingManager();
            var innerParser = new ResultsResponseParser <TestDocumentWithDate>(new SolrDocumentResponseParser <TestDocumentWithDate>(mapper, new DefaultDocumentVisitor(mapper, new DefaultFieldParser()), new SolrDocumentActivator <TestDocumentWithDate>()));
            var parser      = new SolrQueryResultParser <TestDocumentWithDate>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithArraysSimple.xml"));

            Assert.AreEqual(1, results.Count);
            var doc = results[0];
        }
        public void WrongFieldDoesntThrow()
        {
            var docParser   = GetDocumentParser <TestDocumentWithDate>();
            var innerParser = new ResultsResponseParser <TestDocumentWithDate>(docParser);
            var parser      = new SolrQueryResultParser <TestDocumentWithDate>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithArraysSimple.xml"));

            Assert.AreEqual(1, results.Count);
            var doc = results[0];
        }
        public void SupportsNullableGuidWithEmptyField()
        {
            var docParser   = GetDocumentParser <TestDocWithNullableEnum>();
            var innerParser = new ResultsResponseParser <TestDocWithNullableEnum>(docParser);
            var parser      = new SolrQueryResultParser <TestDocWithNullableEnum>(new[] { innerParser });
            var xml         = EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml");
            var results     = parser.Parse(xml);

            Assert.AreEqual(1, results.Count);
            Assert.IsFalse(results[0].BasicView.HasValue);
        }
        public void ParseResultsWithGroups()
        {
            var mapper      = new AttributesMappingManager();
            var innerParser = new GroupingResponseParser <Product>(new SolrDocumentResponseParser <Product>(mapper, new DefaultDocumentVisitor(mapper, new DefaultFieldParser()), new SolrDocumentActivator <Product>()));
            var parser      = new SolrQueryResultParser <Product>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithGroupingOnInstock.xml"));

            Assert.AreEqual(1, results.Grouping.Count);
            Assert.AreEqual(2, results.Grouping["inStock"].Groups.Count());
            Assert.AreEqual(13, results.Grouping["inStock"].Groups.First().NumFound);
        }
Beispiel #23
0
        public void ParseMlthMatch()
        {
            var innerParser = new MoreLikeThisHandlerMatchResponseParser <TestDocWithGuid>(GetDocumentParser <TestDocWithGuid>());
            var parser      = new SolrMoreLikeThisHandlerQueryResultsParser <TestDocWithGuid>(new[] { innerParser });
            var response    = EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithInterestingTermsDetails.xml");
            var results     = parser.Parse(response);

            Assert.IsNotNull(results);
            Assert.IsNotNull(results.Match);
            Assert.AreEqual(new Guid("224fbdc1-12df-4520-9fbe-dd91f916eba1"), results.Match.Key);
        }
Beispiel #24
0
        public void ParseHighlighting2WrappedWithClass()
        {
            var highlights = ParseHighlightingResults(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithHighlighting2.xml"));
            var first      = highlights.First();

            //foreach (var i in first.Value.Snippets.Keys)
            //    Console.WriteLine(i);
            //foreach (var i in first.Value.Snippets["source_en"])
            //    Console.WriteLine(i);
            Assert.Equal(3, first.Value.Snippets["source_en"].Count);
        }
Beispiel #25
0
        public void ParseHighlighting()
        {
            var highlights = ParseHighlightingResults(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithHighlighting.xml"));

            Assert.AreEqual(1, highlights.Count);
            var kv = highlights.First().Value;

            Assert.AreEqual(1, kv.Count);
            Assert.AreEqual("features", kv.First().Key);
            Assert.AreEqual(1, kv.First().Value.Count);
            Assert.That(kv.First().Value.First().Contains("Noise"), Is.True);
        }
        public void Parse()
        {
            var docParser   = GetDocumentParser <TestDocument>();
            var innerParser = new ResultsResponseParser <TestDocument>(docParser);
            var parser      = new SolrQueryResultParser <TestDocument>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml"));

            Assert.AreEqual(1, results.Count);
            var doc = results[0];

            Assert.AreEqual(123456, doc.Id);
        }
        public void EmptyEnumThrows()
        {
            var mapper = new MappingManager();

            mapper.Add(typeof(TestDocWithEnum).GetProperty("En"), "basicview");
            var docParser   = GetDocumentParser <TestDocWithEnum>(mapper);
            var innerParser = new ResultsResponseParser <TestDocWithEnum>(docParser);
            var parser      = new SolrQueryResultParser <TestDocWithEnum>(new[] { innerParser });
            var xml         = EmbeddedResource.GetEmbeddedString(GetType(), "Resources.response.xml");

            parser.Parse(xml);
        }
        public void SupportsNullableDateTime()
        {
            var mapper      = new AttributesMappingManager();
            var innerParser = new ResultsResponseParser <TestDocumentWithNullableDate>(new SolrDocumentResponseParser <TestDocumentWithNullableDate>(mapper, new DefaultDocumentVisitor(mapper, new DefaultFieldParser()), new SolrDocumentActivator <TestDocumentWithNullableDate>()));
            var parser      = new SolrQueryResultParser <TestDocumentWithNullableDate>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithDate.xml"));

            Assert.AreEqual(1, results.Count);
            var doc = results[0];

            Assert.AreEqual(new DateTime(2001, 1, 2, 3, 4, 5), doc.Fecha);
        }
        public void SupportsIEnumerable()
        {
            var mapper      = new AttributesMappingManager();
            var innerParser = new ResultsResponseParser <TestDocumentWithArrays4>(new SolrDocumentResponseParser <TestDocumentWithArrays4>(mapper, new DefaultDocumentVisitor(mapper, new DefaultFieldParser()), new SolrDocumentActivator <TestDocumentWithArrays4>()));
            var parser      = new SolrQueryResultParser <TestDocumentWithArrays4>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithArraysSimple.xml"));

            Assert.AreEqual(1, results.Count);
            var doc = results[0];

            Assert.AreEqual(2, new List <string>(doc.Features).Count);
        }
        public void SupportsEnumAsString()
        {
            var mapper      = new AttributesMappingManager();
            var innerParser = new ResultsResponseParser <TestDocWithEnum>(new SolrDocumentResponseParser <TestDocWithEnum>(mapper, new DefaultDocumentVisitor(mapper, new DefaultFieldParser()), new SolrDocumentActivator <TestDocWithEnum>()));
            var parser      = new SolrQueryResultParser <TestDocWithEnum>(new[] { innerParser });
            var results     = parser.Parse(EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithEnumAsString.xml"));

            Assert.AreEqual(1, results.Count);
            var doc = results[0];

            Console.WriteLine(doc.En);
        }