Ejemplo n.º 1
0
        public void ReorderNullEverythingTest()
        {
            var mannipulator = new JobProfileSearchManipulator();
            var result       = mannipulator.Reorder(null, "test", null);

            result.Results.Should().BeEquivalentTo(Enumerable.Empty <Data.AzureSearch.Models.SearchResultItem <JobProfileIndex> >());
        }
Ejemplo n.º 2
0
        public void ReorderNullDataTest()
        {
            var mannipulator = new JobProfileSearchManipulator();
            SearchProperties searchProperties = new SearchProperties
            {
                Page = 1,
            };

            var result = mannipulator.Reorder(null, "test", searchProperties);

            result.Results.Should().BeEquivalentTo(Enumerable.Empty <Data.AzureSearch.Models.SearchResultItem <JobProfileIndex> >());
        }
        public void ReorderNullResultTest()
        {
            var mannipulator = new JobProfileSearchManipulator();
            SearchResult <Data.Model.JobProfileIndex> data = new SearchResult <JobProfileIndex>
            {
                Results = null
            };

            SearchProperties searchProperties = new SearchProperties
            {
                Page = 1
            };

            var result = mannipulator.Reorder(data, "test", searchProperties);

            result.Results.Should().BeEquivalentTo(Enumerable.Empty <SearchResultItem <JobProfileIndex> >());
        }
        public void TitleAsPriorityTest(string searchTerm, string expectedFirstResult)
        {
            var mannipulator = new JobProfileSearchManipulator();
            SearchResult <Data.Model.JobProfileIndex> data = new SearchResult <JobProfileIndex>
            {
                Results = DummyJobProfileIndex.GenerateJobProfileResultItemDummyCollectionWithOrderPicker("Test")
            };

            SearchProperties searchProperties = new SearchProperties
            {
                Page = 1
            };

            var result = mannipulator.Reorder(data, searchTerm, searchProperties);

            result.Results.First().ResultItem.Title.Should().Be(expectedFirstResult);
        }
        public void ReorderAlternativeTitleTest(string searchTitle, int page, string expectedFirstResult)
        {
            var mannipulator = new JobProfileSearchManipulator();
            SearchResult <Data.Model.JobProfileIndex> data = new SearchResult <JobProfileIndex>
            {
                Results = DummyJobProfileIndex.GenerateJobProfileResultItemDummyCollection("Test", 10, 1)
            };

            SearchProperties searchProperties = new SearchProperties
            {
                Page = page
            };

            var result = mannipulator.Reorder(data, searchTitle, searchProperties);

            result.Results.First().ResultItem.AlternativeTitle.First().Should().Be(expectedFirstResult);
        }