Materialize() 공개 메소드

Add to response fields that needs to read highlighted info.
public Materialize ( ElasticLinq.Response.Model.ElasticResponse response ) : object
response ElasticLinq.Response.Model.ElasticResponse ElasticResponse to obtain the existence of a result.
리턴 object
        public void HighlightMaterializerTests_Throws_If_Not_Chained()
        {
            var respomse = MaterializerTestHelper.CreateSampleResponse(1);
            var materializer = new HighlightElasticMaterializer(null);

            Assert.Throws<ArgumentNullException>(()=>materializer.Materialize(respomse));
        }
        public void HighlightMaterializerTests_Must_recognize_Highlighted_Result()
        {
            var respomse = MaterializerTestHelper.CreateSampleResponseWithHighlight(1);
            var materializer = new HighlightElasticMaterializer(new ListHitsElasticMaterializer(DefaultBySourceItemCreator, typeof(SampleClassWithHighlight)));

            var result = materializer.Materialize(respomse);

            var actualList = Assert.IsType<List<SampleClassWithHighlight>>(result);
            var highlighted = actualList.First().SampleField_Highlight;
            Assert.NotNull(highlighted);
        }