Пример #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>
        /// create an instance of <see cref="AreaRoutingDetailManagementFunctionAdapter"/>
        /// </summary>
        /// <param name="routingDetails">the storage provider</param>
        /// <param name="responseHelper">the response helper</param>
        /// <param name="faultResponses">the fault responses (provider)</param>
        /// <param name="safeOperations">the safe operations (provider)</param>
        /// <param name="analyser">the expression analyser</param>
        /// <param name="actions">the expression action provider</param>
        public AreaRoutingDetailManagementFunctionAdapter(
            IHttpResponseMessageHelper responseHelper,
            IProvideFaultResponses faultResponses,
            IProvideSafeOperations safeOperations,
            IStoreAreaRoutingDetails routingDetails,
            IValidateRoutingDetails validator,
            IAnalyseExpresssions analyser,
            IProvideExpressionActions actions)
        {
            It.IsNull(responseHelper)
            .AsGuard <ArgumentNullException>(nameof(responseHelper));
            It.IsNull(faultResponses)
            .AsGuard <ArgumentNullException>(nameof(faultResponses));
            It.IsNull(safeOperations)
            .AsGuard <ArgumentNullException>(nameof(safeOperations));
            It.IsNull(routingDetails)
            .AsGuard <ArgumentNullException>(nameof(routingDetails));
            It.IsNull(validator)
            .AsGuard <ArgumentNullException>(nameof(validator));
            It.IsNull(analyser)
            .AsGuard <ArgumentNullException>(nameof(analyser));
            It.IsNull(actions)
            .AsGuard <ArgumentNullException>(nameof(actions));

            Respond        = responseHelper;
            Faults         = faultResponses;
            SafeOperations = safeOperations;
            RoutingDetails = routingDetails;
            RoutingDetail  = validator;
            Analyser       = analyser;
            Actions        = actions;
        }
Пример #3
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 AreaRoutingDetailManagementFunctionAdapter MakeSUT(
     IStoreAreaRoutingDetails store,
     IValidateRoutingDetails validator,
     IHttpResponseMessageHelper helper,
     IProvideFaultResponses faults,
     IProvideSafeOperations safe,
     IAnalyseExpresssions analyser,
     IProvideExpressionActions actions) =>
 new AreaRoutingDetailManagementFunctionAdapter(helper, faults, safe, store, validator, analyser, actions);
Пример #4
0
        /// <summary>
        /// initialises an instance of the <see cref="DocumentStore"/>
        /// </summary>
        /// <param name="usingEnvironment">using environment variables</param>
        public DocumentStore(
            IProvideApplicationSettings usingEnvironment,
            ICreateDocumentClients factory,
            IProvideSafeOperations safeOperations)
        {
            It.IsNull(usingEnvironment)
            .AsGuard <ArgumentNullException>(nameof(usingEnvironment));
            It.IsNull(factory)
            .AsGuard <ArgumentNullException>(nameof(factory));
            It.IsNull(safeOperations)
            .AsGuard <ArgumentNullException>(nameof(safeOperations));

            EndpointAddress = usingEnvironment.GetVariable(DocumentStoreEndpointAddressKey);
            It.IsEmpty(EndpointAddress)
            .AsGuard <ArgumentNullException>(nameof(EndpointAddress));

            AccountKey = usingEnvironment.GetVariable(DocumentStoreAccountKey);
            It.IsEmpty(AccountKey)
            .AsGuard <ArgumentNullException>(nameof(AccountKey));

            Client         = factory.CreateClient(new Uri(EndpointAddress), AccountKey);
            SafeOperations = safeOperations;
        }
Пример #5
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="settings">the application settings provider</param>
 /// <param name="factory">the document client factory</param>
 /// <param name="safeOperator">the safe operations provider</param>
 /// <returns>the system under test</returns>
 internal DocumentStore MakeSUT(
     IProvideApplicationSettings settings,
     ICreateDocumentClients factory,
     IProvideSafeOperations safeOperator) =>
 new DocumentStore(settings, factory, safeOperator);