private void SetUpFakesAndCalls(bool addNotApplicable = true)
        {
            psfRepositoryFactoryFake = A.Fake <IPreSearchFiltersFactory>(ops => ops.Strict());
            loggerFake = A.Fake <IApplicationLogger>();
            A.Fake <IWebAppContext>(ops => ops.Strict());

            psfFakeIntrestRepository           = A.Fake <IPreSearchFiltersRepository <PsfInterest> >(ops => ops.Strict());
            psfFakeEnablerRepository           = A.Fake <IPreSearchFiltersRepository <PsfEnabler> >(ops => ops.Strict());
            psfFakeQalificationsRepository     = A.Fake <IPreSearchFiltersRepository <PsfEntryQualification> >(ops => ops.Strict());
            psfFakeTrainingRepository          = A.Fake <IPreSearchFiltersRepository <PsfTrainingRoute> >(ops => ops.Strict());
            psfFakeJobAreaRepository           = A.Fake <IPreSearchFiltersRepository <PsfJobArea> >(ops => ops.Strict());
            psfFakeCareerFocusRepository       = A.Fake <IPreSearchFiltersRepository <PsfCareerFocus> >(ops => ops.Strict());
            psfFakePreferredTaskTypeRepository = A.Fake <IPreSearchFiltersRepository <PsfPreferredTaskType> >(ops => ops.Strict());
            A.Fake <IMapper>(ops => ops.Strict());

            //Set up call
            A.CallTo(() => psfFakeIntrestRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfInterest>(addNotApplicable));
            A.CallTo(() => psfFakeEnablerRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfEnabler>(addNotApplicable));
            A.CallTo(() => psfFakeQalificationsRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfEntryQualification>(addNotApplicable));
            A.CallTo(() => psfFakeTrainingRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfTrainingRoute>(addNotApplicable));
            A.CallTo(() => psfFakeJobAreaRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfJobArea>(addNotApplicable));
            A.CallTo(() => psfFakeCareerFocusRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfCareerFocus>(addNotApplicable));
            A.CallTo(() => psfFakePreferredTaskTypeRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfPreferredTaskType>(addNotApplicable));

            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfInterest>()).Returns(psfFakeIntrestRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfEnabler>()).Returns(psfFakeEnablerRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfEntryQualification>()).Returns(psfFakeQalificationsRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfTrainingRoute>()).Returns(psfFakeTrainingRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfJobArea>()).Returns(psfFakeJobAreaRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfCareerFocus>()).Returns(psfFakeCareerFocusRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfPreferredTaskType>()).Returns(psfFakePreferredTaskTypeRepository);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PreSearchFiltersController"/> class.
 /// </summary>
 /// <param name="applicationLogger">application logger</param>
 /// <param name="preSearchFiltersFactory">Sitefinity Repository to use</param>
 /// <param name="preSearchFilterStateManager">Pre search filter state manager</param>
 /// <param name="autoMapper">Instance of auto mapper</param>
 public PreSearchFiltersController(
     IApplicationLogger applicationLogger,
     IMapper autoMapper,
     IPreSearchFiltersFactory preSearchFiltersFactory,
     IPreSearchFilterStateManager preSearchFilterStateManager) : base(applicationLogger)
 {
     this.preSearchFiltersFactory = preSearchFiltersFactory;
     this.autoMapper = autoMapper;
     this.preSearchFilterStateManager = preSearchFilterStateManager;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PreSearchFiltersController"/> class.
 /// </summary>
 /// <param name="applicationLogger">application logger</param>
 /// <param name="preSearchFiltersFactory">Sitefinity Repository to use</param>
 /// <param name="preSearchFilterStateManager">Pre search filter state manager</param>
 /// <param name="autoMapper">Instance of auto mapper</param>
 /// <param name="searchQueryService">Instance of search query service</param>
 /// <param name="buildSearchFilterService">Instance of search filter service</param>
 /// <param name="asyncHelper">Instance of asyncHelper</param>
 /// <param name="taxonomyRepository">Instance of taxonomyRepository</param>
 public PreSearchFiltersController(
     IApplicationLogger applicationLogger,
     IMapper autoMapper,
     IPreSearchFiltersFactory preSearchFiltersFactory,
     IPreSearchFilterStateManager preSearchFilterStateManager,
     ISearchQueryService <JobProfileIndex> searchQueryService,
     IBuildSearchFilterService buildSearchFilterService,
     IAsyncHelper asyncHelper,
     ITaxonomyRepository taxonomyRepository) : base(applicationLogger)
 {
     this.preSearchFiltersFactory = preSearchFiltersFactory;
     this.autoMapper = autoMapper;
     this.preSearchFilterStateManager = preSearchFilterStateManager;
     this.searchQueryService          = searchQueryService;
     this.buildSearchFilterService    = buildSearchFilterService;
     this.asyncHelper        = asyncHelper;
     this.taxonomyRepository = taxonomyRepository;
 }
        private void SetUpFakesAndCalls(bool addNotApplicable = true)
        {
            psfRepositoryFactoryFake = A.Fake <IPreSearchFiltersFactory>(ops => ops.Strict());
            loggerFake = A.Fake <IApplicationLogger>();
            A.Fake <IWebAppContext>(ops => ops.Strict());

            psfFakeIntrestRepository           = A.Fake <IPreSearchFiltersRepository <PsfInterest> >(ops => ops.Strict());
            psfFakeEnablerRepository           = A.Fake <IPreSearchFiltersRepository <PsfEnabler> >(ops => ops.Strict());
            psfFakeQalificationsRepository     = A.Fake <IPreSearchFiltersRepository <PsfEntryQualification> >(ops => ops.Strict());
            psfFakeTrainingRepository          = A.Fake <IPreSearchFiltersRepository <PsfTrainingRoute> >(ops => ops.Strict());
            psfFakeJobAreaRepository           = A.Fake <IPreSearchFiltersRepository <PsfJobArea> >(ops => ops.Strict());
            psfFakeCareerFocusRepository       = A.Fake <IPreSearchFiltersRepository <PsfCareerFocus> >(ops => ops.Strict());
            psfFakePreferredTaskTypeRepository = A.Fake <IPreSearchFiltersRepository <PsfPreferredTaskType> >(ops => ops.Strict());
            fakeBuildSearchFilterService       = A.Fake <IBuildSearchFilterService>(ops => ops.Strict());
            fakeSearchQueryService             = A.Fake <ISearchQueryService <JobProfileIndex> >(ops => ops.Strict());
            fakeTaxonomyRepository             = A.Fake <ITaxonomyRepository>(ops => ops.Strict());
            fakeAsyncHelper = new AsyncHelper();

            A.Fake <IMapper>(ops => ops.Strict());

            //Set up call
            A.CallTo(() => psfFakeIntrestRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfInterest>(addNotApplicable));
            A.CallTo(() => psfFakeEnablerRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfEnabler>(addNotApplicable));
            A.CallTo(() => psfFakeQalificationsRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfEntryQualification>(addNotApplicable));
            A.CallTo(() => psfFakeTrainingRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfTrainingRoute>(addNotApplicable));
            A.CallTo(() => psfFakeJobAreaRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfJobArea>(addNotApplicable));
            A.CallTo(() => psfFakeCareerFocusRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfCareerFocus>(addNotApplicable));
            A.CallTo(() => psfFakePreferredTaskTypeRepository.GetAllFilters()).Returns(GetTestFilterRepoOptions <PsfPreferredTaskType>(addNotApplicable));
            A.CallTo(() => fakeTaxonomyRepository.GetMany(A <Expression <Func <HierarchicalTaxon, bool> > > ._)).Returns(new EnumerableQuery <HierarchicalTaxon>(new List <HierarchicalTaxon>()));

            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfInterest>()).Returns(psfFakeIntrestRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfEnabler>()).Returns(psfFakeEnablerRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfEntryQualification>()).Returns(psfFakeQalificationsRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfTrainingRoute>()).Returns(psfFakeTrainingRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfJobArea>()).Returns(psfFakeJobAreaRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfCareerFocus>()).Returns(psfFakeCareerFocusRepository);
            A.CallTo(() => psfRepositoryFactoryFake.GetRepository <PsfPreferredTaskType>()).Returns(psfFakePreferredTaskTypeRepository);
        }