Ejemplo n.º 1
0
 public void ShouldReturnSearchSettings(ISearchResults searchResults,[Substitute] SearchService service, SearchSettings searchSettings, ISearchServiceRepository serviceRepository, ISearchSettingsRepository settingsRepository, QueryRepository queryRepository,   IRenderingPropertiesRepository renderingPropertiesRepository, string query)
 {
     settingsRepository.Get(Arg.Any<string>()).Returns(searchSettings);
       var controller = new SearchController(serviceRepository, settingsRepository, queryRepository, renderingPropertiesRepository);
       var result = controller.SearchSettings(query) as ViewResult;
       result.Model.Should().BeOfType<SearchSettings>();
 }
Ejemplo n.º 2
0
 public void ShouldReturnGlobalSearch(ISearchResults searchResults, [Substitute] SearchService service, ISearchServiceRepository serviceRepository, ISearchSettingsRepository settingsRepository, QueryRepository queryRepository, IRenderingPropertiesRepository renderingPropertiesRepository, string query)
 {
     service.Search(Arg.Any<IQuery>()).Returns(searchResults);
       serviceRepository.Get().Returns(service);
       var controller = new SearchController(serviceRepository, settingsRepository, queryRepository, renderingPropertiesRepository);
       var result = controller.GlobalSearch() as ViewResult;
       result.Model.Should().As<ISearchResults>();
 }
Ejemplo n.º 3
0
 public void ShouldReturnPagedSearchResult([Substitute] SearchService service, ISearchServiceRepository serviceRepository, ISearchSettingsRepository settingsRepository, QueryRepository queryRepository, string query, ISearchResults searchResults, [Substitute] SearchController searchController, IRenderingPropertiesRepository renderingPropertiesRepository, [Substitute] PagingSettings pagingSettings)
 {
     renderingPropertiesRepository.Get<PagingSettings>().Returns(pagingSettings);
       service.Search(Arg.Any<IQuery>()).Returns(searchResults);
       serviceRepository.Get().Returns(service);
       var controller = new SearchController(serviceRepository, settingsRepository, queryRepository, renderingPropertiesRepository);
       var result = controller.PagedSearchResults(query, null) as ViewResult;
       result.Model.Should().BeOfType<PagedSearchResults>();
 }