Esempio n. 1
0
 /// <summary>
 /// make (a) 'system under test'
 /// </summary>
 /// <param name="store">the store</param>
 /// <param name="helper">the (response) helper</param>
 /// <param name="faults">the fault (response provider)</param>
 /// <param name="safe">the safe (operations provider)</param>
 /// <returns>the system under test</returns>
 internal LocalAuthorityManagementFunctionAdapter MakeSUT(
     IValidateLocalAuthorities validator,
     IStoreLocalAuthorities store,
     IHttpResponseMessageHelper helper,
     IProvideFaultResponses faults,
     IProvideSafeOperations safe) =>
 new LocalAuthorityManagementFunctionAdapter(helper, faults, safe, store, validator);
        /// <summary>
        /// instantiates an instance of <see cref="ExpressionActionProvider"/>
        /// </summary>
        /// <param name="postcode">the postcode client</param>
        public ExpressionActionProvider(
            ICreatePostcodeClients factory,
            IStoreLocalAuthorities authorityProvider)
        {
            It.IsNull(factory)
            .AsGuard <ArgumentNullException>(nameof(factory));
            It.IsNull(authorityProvider)
            .AsGuard <ArgumentNullException>(nameof(authorityProvider));

            Postcode  = factory.CreateClient();
            Authority = authorityProvider;
            ActionMap = new Dictionary <TypeOfExpression, Func <string, IScopeLoggingContext, Task <string> > >()
            {
                [TypeOfExpression.Town]     = GetTouchpointIDFromTown,
                [TypeOfExpression.Outward]  = GetTouchpointIDFromOutwardCode,
                [TypeOfExpression.Postcode] = GetTouchpointIDFromPostcode
            };
        }
Esempio n. 3
0
        /// <summary>
        /// instantiates a new instance of <see cref="LocalAuthorityManagementFunctionAdapter"/>
        /// </summary>
        /// <param name="responseHelper"></param>
        /// <param name="faultResponses"></param>
        /// <param name="safeOperations"></param>
        /// <param name="authorities"></param>
        public LocalAuthorityManagementFunctionAdapter(
            IHttpResponseMessageHelper responseHelper,
            IProvideFaultResponses faultResponses,
            IProvideSafeOperations safeOperations,
            IStoreLocalAuthorities authorities,
            IValidateLocalAuthorities validator)
        {
            It.IsNull(responseHelper)
            .AsGuard <ArgumentNullException>(nameof(responseHelper));
            It.IsNull(faultResponses)
            .AsGuard <ArgumentNullException>(nameof(faultResponses));
            It.IsNull(safeOperations)
            .AsGuard <ArgumentNullException>(nameof(safeOperations));
            It.IsNull(authorities)
            .AsGuard <ArgumentNullException>(nameof(authorities));
            It.IsNull(validator)
            .AsGuard <ArgumentNullException>(nameof(validator));

            Respond        = responseHelper;
            Faults         = faultResponses;
            SafeOperations = safeOperations;
            Authorities    = authorities;
            Authority      = validator;
        }
 /// <summary>
 /// make (a) 'system under test'
 /// </summary>
 /// <param name="factory">the postcodes client factory</param>
 /// <param name="authorities">the authorities store</param>
 /// <returns>the system under test</returns>
 internal ExpressionActionProvider MakeSUT(
     ICreatePostcodeClients factory,
     IStoreLocalAuthorities authorities) =>
 new ExpressionActionProvider(factory, authorities);