public LegacyRedirectsMapper(BusinessId businessId, LegacyUrlRedirects legacyUrlRedirects, ShortUrlRedirects shortUrlRedirects, IRepository repository)
 {
     _businessId         = businessId;
     _legacyUrlRedirects = legacyUrlRedirects;
     _shortUrlRedirects  = shortUrlRedirects;
     _repository         = repository;
 }
示例#2
0
 public ShortUrlRedirectsMiddleware(RequestDelegate next,
                                    ShortUrlRedirects shortUrlRedirects,
                                    LegacyUrlRedirects legacyUrlRedirects,
                                    ILogger <ShortUrlRedirectsMiddleware> logger,
                                    IRepository repository)
 {
     _next = next;
     _shortUrlRedirects  = shortUrlRedirects;
     _legacyUrlRedirects = legacyUrlRedirects;
     _logger             = logger;
     _repository         = repository;
 }
示例#3
0
 public RedirectsRepository(IContentfulClientManager clientManager,
                            Func <string, ContentfulConfig> createConfig,
                            RedirectBusinessIds redirectBusinessIds,
                            IContentfulFactory <ContentfulRedirect,
                                                BusinessIdToRedirects> contenfulFactory,
                            ShortUrlRedirects shortUrlRedirects,
                            LegacyUrlRedirects legacyUrlRedirects)
 {
     _createConfig        = createConfig;
     _redirectBusinessIds = redirectBusinessIds;
     ClientManager        = clientManager;
     _contenfulFactory    = contenfulFactory;
     _shortUrlRedirects   = shortUrlRedirects;
     _legacyUrlRedirects  = legacyUrlRedirects;
 }
示例#4
0
        public void ShouldCompareKeysWithCurrentCultureIgnoreCase()
        {
            var fromJsonRedirects = new RedirectDictionary
            {
                { "from", "to" },
                { "from_again", "to_again" }
            };

            var businessIdRedirects = new BusinessIdRedirectDictionary
            {
                { "unittest", fromJsonRedirects }
            };

            var redirects = new ShortUrlRedirects(businessIdRedirects);

            redirects.Redirects.Count.Should().Be(1);
            redirects.Redirects["unittest"].Comparer.Should().Be(StringComparer.CurrentCultureIgnoreCase);
        }