public SearchController(ISearchServiceRepository serviceRepository, ISearchContextRepository contextRepository, QueryRepository queryRepository, IRenderingPropertiesRepository renderingPropertiesRepository)
 {
     this.SearchServiceRepository       = serviceRepository;
     this.QueryRepository               = queryRepository;
     this.SearchContextRepository       = contextRepository;
     this.RenderingPropertiesRepository = renderingPropertiesRepository;
 }
Beispiel #2
0
 public SearchController(ISearchServiceRepository serviceRepository, ISearchSettingsRepository settingsRepository, QueryRepository queryRepository, IRenderingPropertiesRepository renderingPropertiesRepository)
 {
     this.searchServiceRepository = serviceRepository;
       this.queryRepository = queryRepository;
       this.searchSettingsRepository = settingsRepository;
       this.renderingPropertiesRepository = renderingPropertiesRepository;
 }
 public SearchController(ISearchServiceRepository serviceRepository, ISearchSettingsRepository settingsRepository, QueryRepository queryRepository, IRenderingPropertiesRepository renderingPropertiesRepository)
 {
     this.searchServiceRepository       = serviceRepository;
     this.queryRepository               = queryRepository;
     this.searchSettingsRepository      = settingsRepository;
     this.renderingPropertiesRepository = renderingPropertiesRepository;
 }
Beispiel #4
0
 public SearchController(ISearchServiceRepository serviceRepository, ISearchContextRepository contextRepository, QueryRepository queryRepository, IRenderingPropertiesRepository renderingPropertiesRepository)
 {
   this.SearchServiceRepository = serviceRepository;
   this.QueryRepository = queryRepository;
   this.SearchContextRepository = contextRepository;
   this.RenderingPropertiesRepository = renderingPropertiesRepository;
 }
 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>();
 }
        public void Get_NullAs1Parameter_ThrowArgumentNullException([Frozen] ISearchServiceRepository searchServiceRepository, [Frozen] ISearchSettings searchSettings)
        {
            var    repo = new NewsRepository(searchServiceRepository);
            Action act  = () => repo.Get(null);

            act.ShouldThrow <ArgumentException>();
        }
 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>();
 }
 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>();
 }
 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>();
 }
Beispiel #10
0
        public DoctorsRepository(Item contextItem, ISearchServiceRepository searchServiceRepository)
        {
            if (contextItem == null)
            {
                throw new ArgumentNullException(nameof(contextItem));
            }
            this.ContextItem = contextItem;

            this.searchServiceRepository = searchServiceRepository;
        }
 public void SearchResults_ShouldReturnModel([Substitute]ControllerContext controllerContext, [Substitute]HttpContextBase context, ISearchResults searchResults, [Substitute]SearchService service, ISearchServiceRepository serviceRepository, ISearchContextRepository contextRepository, QueryRepository queryRepository, IRenderingPropertiesRepository renderingPropertiesRepository, string query)
 {
   service.Search(Arg.Any<IQuery>()).Returns(searchResults);
   serviceRepository.Get().Returns(service);
   var controller = new SearchController(serviceRepository, contextRepository, queryRepository, renderingPropertiesRepository)
                    {
                      ControllerContext = controllerContext
                    };
   controller.ControllerContext.HttpContext = context;
   var result = controller.SearchResults(query) as ViewResult;
   result.Model.Should().As<ISearchResults>();
 }
Beispiel #12
0
 public NewsRepository(Item contextItem, ISearchServiceRepository searchServiceRepository)
 {
   if (contextItem == null)
   {
     throw new ArgumentNullException(nameof(contextItem));
   }
   if (!contextItem.IsDerived(Templates.NewsFolder.ID))
   {
     throw new ArgumentException("Item must derive from NewsFolder", nameof(contextItem));
   }
   this.ContextItem = contextItem;
   this.searchServiceRepository = searchServiceRepository;
 }
Beispiel #13
0
 public NewsRepository(Item contextItem, ISearchServiceRepository searchServiceRepository)
 {
     if (contextItem == null)
     {
         throw new ArgumentNullException(nameof(contextItem));
     }
     if (!contextItem.IsDerived(Templates.NewsFolder.ID))
     {
         throw new ArgumentException("Item must derive from NewsFolder", nameof(contextItem));
     }
     this.ContextItem             = contextItem;
     this.searchServiceRepository = searchServiceRepository;
 }
Beispiel #14
0
        public void Get_ReturnsListOfNews([Frozen] ISearchServiceRepository searchServiceRepository, [Frozen] ISearchSettingsRepository searchSettingsRepository, string itemName, [Substitute] SearchService searchService)
        {
            var id = ID.NewID;

            searchServiceRepository.Get().Returns(searchService);
            var db = new Db
            {
                new DbItem(itemName, id, Templates.NewsFolder.ID)
            };
            var contextItem = db.GetItem(id);
            var repository  = new NewsRepository(contextItem, searchServiceRepository);
            var news        = repository.Get();

            news.Should().As <IEnumerable <Item> >();
        }
        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>();
        }
        public void Get_ItemNotDerivedFromNewsFolderTemplate_ThrowArgumentNullException([Frozen] ISearchServiceRepository searchServiceRepository, [Frozen] ISearchSettings searchSettings, Item contextItem)
        {
            var    repo = new NewsRepository(searchServiceRepository);
            Action act  = () => repo.Get(contextItem);

            act.ShouldThrow <ArgumentException>();
        }
        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>();
        }
Beispiel #18
0
 public PBRepository(ISearchServiceRepository searchServiceRepository)
 {
     this.searchServiceRepository = searchServiceRepository;
 }
 public TreatsPointRepository(ISearchServiceRepository searchServiceRepository)
 {
     this.searchServiceRepository = searchServiceRepository;
 }
 public PersonRepository(ISearchServiceRepository searchServiceRepository)
 {
     this.SearchServiceRepository = searchServiceRepository;
 }
 public PromotionRepository(ISearchServiceRepository searchServiceRepository)
 {
     this.searchServiceRepository = searchServiceRepository;
 }
Beispiel #22
0
 public FAQRepository(ISearchServiceRepository searchService)
 {
     this.searchService = searchService;
 }
Beispiel #23
0
 public SearchService(SearchResultsViewModelFactory searchResultsViewModelFactory, IRenderingPropertiesRepository renderingPropertiesRepository, ISearchServiceRepository searchServiceRepository, ISearchContextRepository searchContextRepository, FacetQueryStringService facetQueryStringService, ITrackerService trackerService)
 {
     this.SearchResultsViewModelFactory = searchResultsViewModelFactory;
     this.RenderingPropertiesRepository = renderingPropertiesRepository;
     this.SearchServiceRepository       = searchServiceRepository;
     this.SearchContextRepository       = searchContextRepository;
     this.FacetQueryStringService       = facetQueryStringService;
     this.TrackerService = trackerService;
 }
 public MBMGalleryRepository(ISearchServiceRepository searchServiceRepository)
 {
     this.searchServiceRepository = searchServiceRepository;
 }
Beispiel #25
0
 public ArticlesRepository(ISearchServiceRepository searchServiceRepository)
 {
     this.searchServiceRepository = searchServiceRepository;
 }
Beispiel #26
0
        public void GetLatestNews_IntegerAs1Parameter_ReturnsNumberOfNewsEquelToParameterValue([Frozen] ISearchServiceRepository searchServiceRepository, [Frozen] ISearchSettingsRepository searchSettingsRepository, string itemName, [Substitute] SearchService searchService, ISearchResults searchResults, List <Item> collection)
        {
            var id = ID.NewID;

            searchResults.Results.Returns(collection.Select(x => new Foundation.Indexing.Models.SearchResult(x)));
            searchService.FindAll().Returns(searchResults);
            searchServiceRepository.Get().Returns(searchService);
            var db = new Db
            {
                new DbItem(itemName, id, Templates.NewsFolder.ID)
            };
            var contextItem = db.GetItem(id);
            var repository  = new NewsRepository(contextItem, searchServiceRepository);
            var news        = repository.GetLatestNews(1);

            news.Count().ShouldBeEquivalentTo(1);
        }
 public RepoTestRepository(ISearchServiceRepository repo)
 {
     searchRepository = repo;
 }
Beispiel #28
0
 public MyRepository(ISearchServiceRepository isearchrepo)
 {
     searchRepo = isearchrepo;
 }
        public void ShouldReturnSearchResults([Substitute] ControllerContext controllerContext, [Substitute] HttpContextBase context, 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);

            controller.ControllerContext             = controllerContext;
            controller.ControllerContext.HttpContext = context;
            var result = controller.SearchResults(query) as ViewResult;

            result.Model.Should().As <ISearchResults>();
        }
 public NewsAnnouncementRepository(ISearchServiceRepository searchServiceRepository)
 {
     this.searchServiceRepository = searchServiceRepository;
 }
        public void ShouldReturnGlobalSearch(ISearchResults searchResults, [Substitute] SearchService service, [Substitute] SearchSettings settings, ISearchServiceRepository serviceRepository, ISearchSettingsRepository settingsRepository, QueryRepository queryRepository, IRenderingPropertiesRepository renderingPropertiesRepository, string query)
        {
            service.Search(Arg.Any <IQuery>()).Returns(searchResults);
            serviceRepository.Get().Returns(service);
            settingsRepository.Get().Returns(settings);
            var controller = new SearchController(serviceRepository, settingsRepository, queryRepository, renderingPropertiesRepository);
            var result     = controller.GlobalSearch() as ViewResult;

            result.Model.Should().As <ISearchResults>();
        }
Beispiel #32
0
        public void Constructor_NullAs1Parameter_ThrowArgumentNullException([Frozen] ISearchServiceRepository searchServiceRepository, [Frozen] ISearchSettingsRepository searchSettingsRepository)
        {
            Action act = () => new NewsRepository(null);

            act.ShouldThrow <ArgumentNullException>();
        }
Beispiel #33
0
        public void Constructor_ItemNotDerivedFromNewsFolterTemplate_ThrowArgumentNullException([Frozen] ISearchServiceRepository searchServiceRepository, [Frozen] ISearchSettingsRepository searchSettingsRepository, Item contextItem)
        {
            Action act = () => new NewsRepository(contextItem, searchServiceRepository);

            act.ShouldThrow <ArgumentException>();
        }
        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>();
        }