Catalogue.Tests.Explicit.exploratory_search_tests.should_be_able_to_highlight_search_terms C# (CSharp) Метод

should_be_able_to_highlight_search_terms() приватный Метод

private should_be_able_to_highlight_search_terms ( ) : void
Результат void
        public void should_be_able_to_highlight_search_terms()
        {
            FieldHighlightings lites;

            List<Record> results = Db.Advanced.DocumentQuery<Record>("Records/SearchQuery")
                .Highlight("Title", 128, 2, out lites)
                .SetHighlighterTags("<strong>", "</strong>")
                .Search("Title", "north").Boost(10)
                .Take(10)
                .ToList();

            results.Count.Should().Be(10);
            lites.FieldName.Should().Be("Title");
            lites.GetFragments("records/" + results.First().Id)
                .First()
                .Should()
                .ContainEquivalentOf("<strong>north</strong>");
        }