/// <summary>
 /// Creates an instance of <see cref="ArticlesWidgetController"/> class.
 /// </summary>
 /// <param name="repository">Repository for retrieving articles.</param>
 /// <param name="outputCacheDependencies">Output cache dependency handling.</param>
 /// <param name="propertiesRetriever">Retriever for widget properties.</param>
 /// <param name="currentPageRetriever">Retriever for current page where is the widget used.</param>
 /// <remarks>Use this constructor for tests to handle dependencies.</remarks>
 public ArticlesWidgetController(IArticleRepository repository, IOutputCacheDependencies outputCacheDependencies,
                                 IComponentPropertiesRetriever <ArticlesWidgetProperties> propertiesRetriever,
                                 ICurrentPageRetriever currentPageRetriever) : base(propertiesRetriever, currentPageRetriever)
 {
     _articleRepository       = repository;
     _outputCacheDependencies = outputCacheDependencies;
 }
        public void SetUp()
        {
            var siteService = Substitute.For <ISiteService>();
            var site        = Substitute.For <ISiteInfo>();

            site.SiteName = "site";
            siteService.CurrentSite.Returns(site);
            Service.Use <ISiteService>(siteService);

            EnsureServiceContainer();

            Fake().DocumentType <Article>(Article.CLASS_NAME);
            article = TreeNode.New <Article>()
                      .With(a => a.Fields.Title = ARTICLE_TITLE)
                      .With(a => a.SetValue("DocumentID", DOCUMENT_ID));
            dependencies = Substitute.For <IOutputCacheDependencies>();

            dataContextRetriever = Substitute.For <IPageDataContextRetriever>();
            var section = Substitute.For <TreeNode>();

            section.NodeAliasPath.Returns("/section");
            var dataContext = Substitute.For <IPageDataContext <TreeNode> >();

            dataContext.Page.Returns(section);
            dataContextRetriever.Retrieve <TreeNode>().Returns(dataContext);
            articleRepository      = Substitute.For <IArticleRepository>();
            pageUrlRetriever       = Substitute.For <IPageUrlRetriever>();
            attachmentUrlRetriever = Substitute.For <IPageAttachmentUrlRetriever>();
        }
Exemplo n.º 3
0
 public CafesController(ICafeRepository cafeRepository, ICountryRepository countryRepository, LocalizationService localizationService, IOutputCacheDependencies outputCacheDependencies)
 {
     mLocalizationService = localizationService;
     mCountryRepository = countryRepository;
     mCafeRepository = cafeRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 4
0
 public HomeController(IArticleRepository repository, IAboutUsRepository aboutUsRepository, ICafeRepository cafeRepository, IOutputCacheDependencies outputCacheDependencies)
 {
     mArticleRepository       = repository;
     mAboutUsRepository       = aboutUsRepository;
     mCafeRepository          = cafeRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 5
0
 public HomeController(IArticleRepository repository, IAboutUsRepository aboutUsRepository, ICafeRepository cafeRepository, IOutputCacheDependencies outputCacheDependencies)
 {
     mArticleRepository = repository;
     mAboutUsRepository = aboutUsRepository;
     mCafeRepository = cafeRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 6
0
 public CafesController(ICafeRepository cafeRepository, ICountryRepository countryRepository, LocalizationService localizationService, IOutputCacheDependencies outputCacheDependencies)
 {
     mLocalizationService = localizationService;
     mCountryRepository = countryRepository;
     mCafeRepository = cafeRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CachingRepositoryDecorator"/> class.
 /// </summary>
 /// <param name="cacheItemDuration">Time duration during which the repository method result is cached.</param>
 /// <param name="contentItemMetadataProvider">Object that provides information about pages and info objects using their runtime type.</param>
 /// <param name="cacheEnabled">Indicates whether caching is enabled.</param>
 public CachingRepositoryDecorator(TimeSpan cacheItemDuration, IContentItemMetadataProvider contentItemMetadataProvider, bool cacheEnabled, IOutputCacheDependencies outputCacheDependencies)
 {
     mCacheItemDuration           = cacheItemDuration;
     mContentItemMetadataProvider = contentItemMetadataProvider;
     mCacheEnabled            = cacheEnabled;
     mOutputCacheDependencies = outputCacheDependencies;
 }
 /// <summary>
 /// Creates an instance of <see cref="ProductCardWidgetController"/> class.
 /// </summary>
 /// <param name="repository">Repository for retrieving products.</param>
 /// <param name="outputCacheDependencies">Output cache dependency handling.</param>
 public ProductCardWidgetController(IProductRepository repository,
                                    IOutputCacheDependencies outputCacheDependencies,
                                    IComponentPropertiesRetriever componentPropertiesRetriever)
 {
     this.repository = repository;
     this.outputCacheDependencies      = outputCacheDependencies;
     this.componentPropertiesRetriever = componentPropertiesRetriever;
 }
 public HomeController(IPromotedContentRepository repository,
                       IHomeRepository homeRepository,
                       IOutputCacheDependencies outputCacheDependencies)
 {
     mHighlightRepository     = repository;
     mHomeRepository          = homeRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
 public KenticoNavigationRepository(string cultureName, bool latestVersionEnabled, IOutputCacheDependencies cacheDependencies, IGeneralDocumentRepository GeneralDocumentRepository, IKenticoNavigationRepositoryHelper Helper)
 {
     this.cultureName          = cultureName;
     this.latestVersionEnabled = latestVersionEnabled;
     this.cacheDependencies    = cacheDependencies;
     _GeneralDocumentRepo      = GeneralDocumentRepository;
     _helper = Helper;
 }
Exemplo n.º 11
0
 public HomeController(IPromotedContentRepository repository,
                       IHomeRepository homeRepository,
                       IOutputCacheDependencies outputCacheDependencies,
                       IContactTrackingService contactTrackingService)
 {
     mHighlightRepository     = repository;
     mHomeRepository          = homeRepository;
     mOutputCacheDependencies = outputCacheDependencies;
     mContactTrackingService  = contactTrackingService;
 }
 /// <summary>
 /// Creates an instance of <see cref="CardWidgetController"/> class.
 /// </summary>
 public CardWidgetController(IMediaFileRepository mediaFileRepository,
                             IOutputCacheDependencies outputCacheDependencies,
                             IComponentPropertiesRetriever componentPropertiesRetriever,
                             IMediaFileUrlRetriever mediaFileUrlRetriever)
 {
     this.mediaFileRepository          = mediaFileRepository;
     this.outputCacheDependencies      = outputCacheDependencies;
     this.componentPropertiesRetriever = componentPropertiesRetriever;
     this.mediaFileUrlRetriever        = mediaFileUrlRetriever;
 }
Exemplo n.º 13
0
        public ExampleCacheController(IExamplePageTypeRepository ExampleRepo, IExampleModuleClassRepository ExampleModuleClassRepo, IOutputCacheDependencies OutputCacheDependencies, ICacheHelper CacheHelper)
        {
            // Use constructor injection to get a handle on our ExampleService
            mExamplePageTypeRepo    = ExampleRepo;
            mExampleModuleClassRepo = ExampleModuleClassRepo;

            // Ability to add Kentico Cache Dependencies to OutputCache
            mOutputCacheDependencies = OutputCacheDependencies;
            mCacheHelper             = CacheHelper;
        }
 /// <summary>
 /// Initializes an instance of <see cref="CafeCardWidgetController"/> class.
 /// </summary>
 /// <param name="repository">Repository for retrieving cafes.</param>
 /// <param name="outputCacheDependencies">Output cache dependency handling.</param>
 public CafeCardWidgetController(ICafeRepository repository,
                                 IOutputCacheDependencies outputCacheDependencies,
                                 IComponentPropertiesRetriever componentPropertiesRetriever,
                                 IPageAttachmentUrlRetriever attachmentUrlRetriever)
 {
     this.repository = repository;
     this.outputCacheDependencies      = outputCacheDependencies;
     this.componentPropertiesRetriever = componentPropertiesRetriever;
     this.attachmentUrlRetriever       = attachmentUrlRetriever;
 }
Exemplo n.º 15
0
 public HomeController(
     IHomePageQuery homePageQuery,
     IPageBuilderInitializer pageBuilderInitializer,
     IOutputCacheDependencies outputCacheDependencies,
     ISiteMetaService <SiteMeta> siteMetaService)
 {
     this.homePageQuery           = homePageQuery;
     this.pageBuilderInitializer  = pageBuilderInitializer;
     this.outputCacheDependencies = outputCacheDependencies;
     this.siteMetaService         = siteMetaService;
 }
Exemplo n.º 16
0
 public void SetUp()
 {
     Fake().DocumentType<Article>(Article.CLASS_NAME);
     mArticle = TreeNode.New<Article>().With(a => a.DocumentName = mDocumentName);
     mDependencies = Substitute.For<IOutputCacheDependencies>();
     
     var repository = Substitute.For<IArticleRepository>();
     repository.GetArticle(1).Returns(mArticle);
     
     mController = new ArticlesController(repository, mDependencies);
 }
Exemplo n.º 17
0
 public ContactsController(ICafeRepository cafeRepository, ISocialLinkRepository socialLinkRepository,
                           IContactRepository contactRepository, IFormItemRepository formItemRepository,
                           ICountryRepository countryRepository, IOutputCacheDependencies outputCacheDependencies)
 {
     mCountryRepository       = countryRepository;
     mFormItemRepository      = formItemRepository;
     mCafeRepository          = cafeRepository;
     mSocialLinkRepository    = socialLinkRepository;
     mContactRepository       = contactRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
 /// <summary>
 /// Creates an instance of <see cref="ImageWidgetController"/> class.
 /// </summary>
 /// <param name="pageDataContextRetriever">Retriever for page data context.</param>
 /// <param name="outputCacheDependencies">Output cache dependencies.</param>
 /// <param name="propertiesRetriever">Retriever for widget properties.</param>
 public ImageWidgetController(
     IPageDataContextRetriever pageDataContextRetriever,
     IOutputCacheDependencies outputCacheDependencies,
     IComponentPropertiesRetriever propertiesRetriever,
     IPageAttachmentUrlRetriever attachmentUrlRetriever)
 {
     this.pageDataContextRetriever = pageDataContextRetriever;
     this.outputCacheDependencies  = outputCacheDependencies;
     this.propertiesRetriever      = propertiesRetriever;
     this.attachmentUrlRetriever   = attachmentUrlRetriever;
 }
Exemplo n.º 19
0
 public ContactsController(ICafeRepository cafeRepository, ISocialLinkRepository socialLinkRepository,
     IContactRepository contactRepository, IFormItemRepository formItemRepository,
     ICountryRepository countryRepository, IOutputCacheDependencies outputCacheDependencies)
 {
     mCountryRepository = countryRepository;
     mFormItemRepository = formItemRepository;
     mCafeRepository = cafeRepository;
     mSocialLinkRepository = socialLinkRepository;
     mContactRepository = contactRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 20
0
 public ArticlesController(IPageDataContextRetriever dataContextRetriever,
                           IArticleRepository articleRepository,
                           IPageUrlRetriever pageUrlRetriever,
                           IPageAttachmentUrlRetriever attachmentUrlRetriever,
                           IOutputCacheDependencies outputCacheDependencies)
 {
     this.dataContextRetriever    = dataContextRetriever;
     this.articleRepository       = articleRepository;
     this.pageUrlRetriever        = pageUrlRetriever;
     this.attachmentUrlRetriever  = attachmentUrlRetriever;
     this.outputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 21
0
        public void SetUp()
        {
            Fake().DocumentType <Article>(Article.CLASS_NAME);
            mArticle      = TreeNode.New <Article>().With(a => a.DocumentName = mDocumentName);
            mDependencies = Substitute.For <IOutputCacheDependencies>();

            var repository = Substitute.For <IArticleRepository>();

            repository.GetArticle(1).Returns(mArticle);

            mController = new ArticlesController(repository, mDependencies);
        }
 public CafesController(IPageDataContextRetriever dataContextRetriever,
                        ICafeRepository cafeRespository,
                        ICountryRepository countryRepository,
                        IOutputCacheDependencies outputCacheDependencies,
                        IPageAttachmentUrlRetriever attachmentUrlRetriever)
 {
     this.dataContextRetriever    = dataContextRetriever;
     this.cafeRespository         = cafeRespository;
     this.countryRepository       = countryRepository;
     this.outputCacheDependencies = outputCacheDependencies;
     this.attachmentUrlRetriever  = attachmentUrlRetriever;
 }
 /// <summary>
 /// Initializes an instance of <see cref="ArticlesWidgetController"/> class.
 /// </summary>
 /// <param name="repository">Articles repository.</param>
 /// <param name="outputCacheDependencies">Output cache dependency handling.</param>
 /// <param name="propertiesRetriever">Retriever for widget properties.</param>
 /// <param name="pageBuilderDataContextRetriever">Retriever for page builder data context.</param>
 /// <param name="pageUrlRetriever">Retriever for page URLs.</param>
 /// <param name="attachmentUrlRetriever">Retriever for page attachment URLs.</param>
 /// <remarks>Use this constructor for tests to handle dependencies.</remarks>
 public ArticlesWidgetController(IArticleRepository repository,
                                 IOutputCacheDependencies outputCacheDependencies,
                                 IComponentPropertiesRetriever propertiesRetriever,
                                 IPageUrlRetriever pageUrlRetriever,
                                 IPageAttachmentUrlRetriever attachmentUrlRetriever)
 {
     this.repository = repository;
     this.outputCacheDependencies = outputCacheDependencies;
     this.propertiesRetriever     = propertiesRetriever;
     this.pageUrlRetriever        = pageUrlRetriever;
     this.attachmentUrlRetriever  = attachmentUrlRetriever;
 }
Exemplo n.º 24
0
 public AboutController(IPageDataContextRetriever dataRetriever,
                        IAboutUsRepository aboutUsRepository,
                        IReferenceRepository referenceRepository,
                        IOutputCacheDependencies outputCacheDependencies,
                        IPageAttachmentUrlRetriever attachmentUrlRetriever)
 {
     this.dataRetriever           = dataRetriever;
     this.aboutUsRepository       = aboutUsRepository;
     this.referenceRepository     = referenceRepository;
     this.outputCacheDependencies = outputCacheDependencies;
     this.attachmentUrlRetriever  = attachmentUrlRetriever;
 }
        public void SetUp()
        {
            Fake().DocumentType <Article>(Article.CLASS_NAME);
            mArticle = TreeNode.New <Article>()
                       .With(a => a.Fields.Title = ARTICLE_TITLE)
                       .With(a => a.SetValue("DocumentID", DOCUMENT_ID));
            mDependencies = Substitute.For <IOutputCacheDependencies>();

            var repository = Substitute.For <IArticleRepository>();

            repository.GetArticle(nodeGuid).Returns(mArticle);

            mController = new ArticlesController(repository, mDependencies);
        }
 public HomeController(IPageDataContextRetriever pageDataContextRetriever,
                       IHomeRepository homeSectionRepository,
                       IReferenceRepository referenceRepository,
                       IOutputCacheDependencies outputCacheDependencies,
                       IPageUrlRetriever pageUrlRetriever,
                       IPageAttachmentUrlRetriever attachmentUrlRetriever)
 {
     this.pageDataContextRetriever = pageDataContextRetriever;
     this.homeSectionRepository    = homeSectionRepository;
     this.referenceRepository      = referenceRepository;
     this.pageUrlRetriever         = pageUrlRetriever;
     this.outputCacheDependencies  = outputCacheDependencies;
     this.attachmentUrlRetriever   = attachmentUrlRetriever;
 }
 public ManufacturersController(IPageDataContextRetriever dataRetriever,
                                IManufacturerRepository manufacturerRepository,
                                IProductRepository productRepository,
                                ICalculationService calculationService,
                                IPublicStatusRepository publicStatusRepository,
                                IOutputCacheDependencies outputCacheDependencies,
                                IPageUrlRetriever pageUrlRetriever)
 {
     this.dataRetriever           = dataRetriever;
     this.manufacturerRepository  = manufacturerRepository;
     this.productRepository       = productRepository;
     this.calculationService      = calculationService;
     this.publicStatusRepository  = publicStatusRepository;
     this.outputCacheDependencies = outputCacheDependencies;
     this.pageUrlRetriever        = pageUrlRetriever;
 }
Exemplo n.º 28
0
 /// <summary>
 /// Creates an instance of <see cref="BannerWidgetController"/> class.
 /// </summary>
 /// <param name="mediaFileRepository">Repository for media files.</param>
 /// <param name="outputCacheDependencies">Output cache dependencies.</param>
 public HeroImageWidgetController(IMediaFileRepository mediaFileRepository, IOutputCacheDependencies outputCacheDependencies)
 {
     this.mediaFileRepository     = mediaFileRepository;
     this.outputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 29
0
 public ArticlesController(IArticleRepository repository, IOutputCacheDependencies outputCacheDependencies)
 {
     mArticleRepository       = repository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 30
0
 public AboutController(IAboutUsRepository aboutUsRepository, IOutputCacheDependencies outputCacheDependencies)
 {
     mAboutUsRepository = aboutUsRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 31
0
 public CafesController(ICafeRepository cafeRepository, ICountryRepository countryRepository, IOutputCacheDependencies outputCacheDependencies)
 {
     mCountryRepository = countryRepository;
     mCafeRepository = cafeRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
 /// <summary>
 /// Creates an instance of <see cref="CafeCardWidgetController"/> class.
 /// </summary>
 /// <param name="repository">Repository for retrieving cafes.</param>
 /// <param name="outputCacheDependencies">Output cache dependency handling.</param>
 public CafeCardWidgetController(ICafeRepository repository, IOutputCacheDependencies outputCacheDependencies)
 {
     mCafeRepository          = repository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 33
0
 public ArticlesController(IArticleRepository repository, IOutputCacheDependencies outputCacheDependencies)
 {
     mArticleRepository = repository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 34
0
 public CafesController(ICafeRepository cafeRepository, ICountryRepository countryRepository, IOutputCacheDependencies outputCacheDependencies)
 {
     mCountryRepository       = countryRepository;
     mCafeRepository          = cafeRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
 /// <summary>
 /// Creates an instance of <see cref="ArticlesWidgetController"/> class.
 /// </summary>
 /// <param name="repository">Repository for retrieving articles.</param>
 /// <param name="outputCacheDependencies">Output cache dependency handling.</param>
 public ArticlesWidgetController(IArticleRepository repository, IOutputCacheDependencies outputCacheDependencies)
 {
     _articleRepository       = repository;
     _outputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 36
0
 public HomeController(IHomeRepository homeRepository,
                       IOutputCacheDependencies outputCacheDependencies)
 {
     mHomeRepository          = homeRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }
Exemplo n.º 37
0
 public AboutController(IAboutUsRepository aboutUsRepository, IOutputCacheDependencies outputCacheDependencies)
 {
     mAboutUsRepository       = aboutUsRepository;
     mOutputCacheDependencies = outputCacheDependencies;
 }