Пример #1
0
 public void SearchResultsHeader_ShouldReturnModel(ISearchResults searchResults, [Substitute]SearchService service, SearchContext searchContext, ISearchServiceRepository serviceRepository, ISearchContextRepository contextRepository, QueryRepository queryRepository, IRenderingPropertiesRepository renderingPropertiesRepository, string query)
 {
   contextRepository.Get().Returns(searchContext);
   var controller = new SearchController(serviceRepository, contextRepository, queryRepository, renderingPropertiesRepository);
   var result = controller.SearchResultsHeader(query) as ViewResult;
   result.Model.Should().BeOfType<SearchContext>();
 }
Пример #2
0
 public void GlobalSearch_ShouldReturnModel(ISearchResults searchResults, [Substitute]SearchService service, SearchContext context, ISearchServiceRepository serviceRepository, ISearchContextRepository contextRepository, QueryRepository queryRepository, IRenderingPropertiesRepository renderingPropertiesRepository, string query)
 {
   service.Search(Arg.Any<IQuery>()).Returns(searchResults);
   serviceRepository.Get().Returns(service);
   contextRepository.Get().Returns(context);
   var controller = new SearchController(serviceRepository, contextRepository, queryRepository, renderingPropertiesRepository);
   var result = controller.GlobalSearch() as ViewResult;
   result.Model.Should().As<ISearchResults>();
 }
Пример #3
0
 public void PagedSearchResults_ShouldReturnModel([Substitute]SearchService service, PagingSettings pagingSettings, SearchContext searchContext, ISearchContextRepository contextRepository, QueryRepository queryRepository, ISearchServiceRepository serviceRepository, string query, ISearchResults searchResults, IRenderingPropertiesRepository renderingPropertiesRepository)
 {
   renderingPropertiesRepository.Get<PagingSettings>().Returns(pagingSettings);
   service.Search(Arg.Any<IQuery>()).Returns(searchResults);
   serviceRepository.Get().Returns(service);
   contextRepository.Get().Returns(searchContext);
   var controller = new SearchController(serviceRepository, contextRepository, queryRepository, renderingPropertiesRepository);
   var result = controller.PagedSearchResults(query, null) as ViewResult;
   result.Model.Should().BeOfType<PagedSearchResults>();
 }
Пример #4
0
 public void SearchResults_CanBeInitialized(SearchContext context, [NoAutoProperties] SearchResults results)
 {
 }