Beispiel #1
0
 public GetLocationsOperation(IUpsClient upsClient, IRequestBuilder requestBuilder, IResponseBuilder responseBuilder, IControllerHelper controllerHelper)
 {
     _upsClient        = upsClient;
     _requestBuilder   = requestBuilder;
     _responseBuilder  = responseBuilder;
     _controllerHelper = controllerHelper;
 }
 public GenericContentFeatureService(
     IResponseBuilder responseBuilder,
     params IContentScenario <TContext>[] contentScenarios)
 {
     _responseBuilder  = responseBuilder;
     _contentScenarios = contentScenarios;
 }
        public void Run(DataContainer commandData, ICommand command, IResponseBuilder responseBuilder)
        {
            RequestWorkPipelineValidator.Validate(commandData, command, responseBuilder);

            command.Data.Integrate(commandData);
            command.Work();
        }
Beispiel #4
0
 public SchoolFlowStepBeforeSave(
     IResponseBuilder responseBuilder,
     IStringLocalizer <SharedResource> localizer)
 {
     _responseBuilder = responseBuilder;
     _localizer       = localizer;
 }
 public RequestWorker(string name, IRequestWorkPipeline pipeline, ICommand command = null, IResponseBuilder builder = null)
 {
     Name            = name;
     Command         = command;
     ResponseBuilder = builder;
     Pipeline        = pipeline;
 }
Beispiel #6
0
 public ConfigController(IResponseBuilder responseBuilder, IDBService dbService, IHttpContextProxy httpContextProxy, ILogger logger)
 {
     _responseBuilder  = responseBuilder;
     _dbService        = dbService;
     _httpContextProxy = httpContextProxy;
     _logger           = logger;
 }
Beispiel #7
0
 public Dispatcher(ILogger <Dispatcher> log,
                   IControlHandler controlHandler,
                   IExamineHandler examineHandler,
                   IInventoryHandler inventoryHandler,
                   ILockHandler lockHandler,
                   ILookAroundHandler lookHandler,
                   IMagicHandler magicHandler,
                   IMoveDirectionHandler moveDirHandler,
                   IMoveFeatureHandler moveFeatureHandler,
                   IMoveLocationHandler moveLocHandler,
                   IOnOffHandler onOffHandler,
                   IResponseBuilder responseBuilder,
                   AdventureContext context)
 {
     _log                = log;
     _controlHandler     = controlHandler;
     _examineHandler     = examineHandler;
     _inventoryHandler   = inventoryHandler;
     _lockHandler        = lockHandler;
     _lookHandler        = lookHandler;
     _magicHandler       = magicHandler;
     _moveDirHandler     = moveDirHandler;
     _moveFeatureHandler = moveFeatureHandler;
     _moveLocHandler     = moveLocHandler;
     _onOffHandler       = onOffHandler;
     _responseBuilder    = responseBuilder;
     _advContext         = context;
 }
 public SearchFeedItemsOperation(IRequestBuilder requestBuilder, IResponseBuilder responseBuilder, IFeedRepository feedRepository, IHalResponseBuilder halResponseBuilder)
 {
     _requestBuilder     = requestBuilder;
     _responseBuilder    = responseBuilder;
     _feedRepository     = feedRepository;
     _halResponseBuilder = halResponseBuilder;
 }
Beispiel #9
0
 public NationStatsCommand(IServiceProvider serviceProvider)
 {
     _logger          = Log.ForContext <NationStatsCommand>();
     _dispatcher      = serviceProvider.GetRequiredService <IRequestDispatcher>();
     _config          = serviceProvider.GetRequiredService <IOptions <AppSettings> >().Value;
     _responseBuilder = serviceProvider.GetRequiredService <IResponseBuilder>();
 }
Beispiel #10
0
 public LoginController(IServiceResolver serviceResolver, ILogger logger, IResponseBuilder responseBuilder, IHttpContextProxy httpContextProxy)
 {
     _responseBuilder  = responseBuilder;
     _httpContextProxy = httpContextProxy;
     _serviceResolver  = serviceResolver;
     _logger           = logger;
 }
 public static void Validate(DataContainer commandData, ICommand command, IResponseBuilder builder)
 {
     if (command != null && command.Data == null)
     {
         throw new System.Exception("Command data container hasn't been initialized");
     }
 }
Beispiel #12
0
 public DeleteProductOperation(IRemoveProductValidator validator, IResponseBuilder responseBuilder, IControllerHelper controllerHelper, ICommandSender commandSender)
 {
     _validator        = validator;
     _responseBuilder  = responseBuilder;
     _controllerHelper = controllerHelper;
     _commandSender    = commandSender;
 }
Beispiel #13
0
 public ValidateDtoFilter(
     IResponseBuilder responseBuilder,
     IModelStateResolver modelStateResolver)
 {
     _responseBuilder    = responseBuilder;
     _modelStateResolver = modelStateResolver;
 }
Beispiel #14
0
 public CommandTests()
 {
     TableGeneratorService = Substitute.For <IPrefixTableGenerator>();
     MatcherService        = Substitute.For <IMatcher>();
     ResponseService       = Substitute.For <IResponseBuilder>();
     Container             = BuildContainer();
 }
Beispiel #15
0
 public TnCController(IHttpContextProxy httpContextProxy, IResponseBuilder responseBuilder, IDBService dBService, IKeyValueStorage keyValueStorage, IStaticContentHandler staticContentHandler, IApiGatewayService apiGatewayService, ILogger logger, IZNxtUserService zNxtUserService)
 {
     _responseBuilder  = responseBuilder;
     _httpContextProxy = httpContextProxy;
     _logger           = logger;
     _userController   = new UserController(responseBuilder, logger, httpContextProxy, dBService, keyValueStorage, staticContentHandler, apiGatewayService, zNxtUserService);
 }
 private RequestMessage FlushAndGetRequest(IResponseBuilder resp)
 {
     PrepareResponse(resp);
     _ep.Flush();
     ((DefaultEventProcessor)_ep).WaitUntilInactive();
     return(GetLastRequest());
 }
 public RemoveShopCommentOperation(IRemoveShopCommentValidator validator, IResponseBuilder responseBuilder, IControllerHelper controllerHelper, ICommandSender commandSender)
 {
     _validator        = validator;
     _responseBuilder  = responseBuilder;
     _controllerHelper = controllerHelper;
     _commandSender    = commandSender;
 }
Beispiel #18
0
 public void Setup()
 {
     //string twitter_api_username = ConfigurationManager.AppSettings["twitter_user"];
     //string twitter_api_password = ConfigurationManager.AppSettings["twitter_pass"];
     //_credentials = new NetworkCredential(twitter_api_username, twitter_api_password);
     _oAuthTwitter = new OAuthTwitterResponseBuilder();
 }
 public OrdersController(ISearchOrdersOperation searchOrdersOperation, IResponseBuilder responseBuilder,
                         IUpdateOrderOperation updateOrderOperation, IDeleteOrderOperation deleteOrderOperation,
                         IAddOrderLineOperation addOrderLineOperation, IGetOrderStatusOperation getOrderStatusOperation,
                         IGetOrderOperation getOrderOperation, IHandlersInitiator handlersInitiator, IGetOrderTransactionOperation getOrderTransactionOperation,
                         IPurchaseLabelOperation purchaseLabelOperation, IConfirmOrderLabelPurchaseOperation confirmOrderLabelPurchaseOperation, IConfirmOrderPurchaseOperation confirmOrderPurchaseOperation,
                         IGetOrderLabelOperation getOrderLabelOperation, ICancelOrderOperation cancelOrderOperation, IGetPaymentDetailsOperation getPaymentDetailsOperation,
                         ITrackOrderOperation trackOrderOperation, IConfirmOrderReceptionOperation confirmOrderReceptionOperation) : base(handlersInitiator)
 {
     _searchOrdersOperation              = searchOrdersOperation;
     _responseBuilder                    = responseBuilder;
     _updateOrderOperation               = updateOrderOperation;
     _deleteOrderOperation               = deleteOrderOperation;
     _addOrderLineOperation              = addOrderLineOperation;
     _getOrderStatusOperation            = getOrderStatusOperation;
     _getOrderOperation                  = getOrderOperation;
     _getOrderTransactionOperation       = getOrderTransactionOperation;
     _purchaseLabelOperation             = purchaseLabelOperation;
     _confirmOrderLabelPurchaseOperation = confirmOrderLabelPurchaseOperation;
     _confirmOrderPurchaseOperation      = confirmOrderPurchaseOperation;
     _getOrderLabelOperation             = getOrderLabelOperation;
     _cancelOrderOperation               = cancelOrderOperation;
     _getPaymentDetailsOperation         = getPaymentDetailsOperation;
     _trackOrderOperation                = trackOrderOperation;
     _confirmOrderReceptionOperation     = confirmOrderReceptionOperation;
 }
 public AppInstallerContoller(IDBService dbService, IServiceResolver serviceResolver, IResponseBuilder responseBuilder, IHttpContextProxy httpContextProxy, IDBServiceConfig dbConfig)
 {
     _responseBuilder  = responseBuilder;
     _dbService        = dbService;
     _httpContextProxy = httpContextProxy;
     _dbConfig         = dbConfig;
     _serviceResolver  = serviceResolver;
 }
Beispiel #21
0
 private static void TryPatchFile(IRequest request, string directory, IResponseBuilder responseBuilder)
 {
     var hash = EncryptionTools.GetSha1(directory + request.Resource);
     if (Match(request, hash))
         PatchFile(request, directory, responseBuilder);
     else
         SetPreconditionFail(responseBuilder);
 }
Beispiel #22
0
 public OTPLogin(IResponseBuilder responseBuilder, ILogger logger, IHttpContextProxy httpContextProxy, IDBService dBService, IZNxtUserService ZNxtUserService)
 {
     _responseBuilder  = responseBuilder;
     _httpContextProxy = httpContextProxy;
     _ZNxtUserService  = ZNxtUserService;
     _logger           = logger;
     _dBService        = dBService;
 }
Beispiel #23
0
 private static void PatchFile(IRequest request, string directory, IResponseBuilder responseBuilder)
 {
     File.WriteAllText(directory + request.Resource, request.Body);
     var hash = EncryptionTools.GetSha1(directory + request.Resource);
     responseBuilder.SetStatusCode(204);
     responseBuilder.AddHeader(Headers.ContentLocation, request.Resource);
     responseBuilder.AddHeader(Headers.ETag, hash);
 }
Beispiel #24
0
 public GetRatingsOperation(IRequestBuilder requestBuilder, IUpsClient upsClient, IResponseBuilder responseBuilder, IControllerHelper controllerHelper, ISettingsProvider settingsProvider)
 {
     _requestBuilder   = requestBuilder;
     _upsClient        = upsClient;
     _responseBuilder  = responseBuilder;
     _controllerHelper = controllerHelper;
     _settingsProvider = settingsProvider;
 }
Beispiel #25
0
        public ApiBaseService(IHttpContextProxy httpContextProxy, IDBService dBService, ILogger logger, IResponseBuilder responseBuilder)

        {
            HttpProxy        = httpContextProxy;
            Logger           = logger;
            DBProxy          = dBService;
            _responseBuilder = responseBuilder;
        }
 public AddDiscountOperation(IAddDiscountValidator validator, IRequestBuilder requestBuilder, IResponseBuilder responseBuilder, IControllerHelper controllerHelper, ICommandSender commandSender)
 {
     _validator        = validator;
     _requestBuilder   = requestBuilder;
     _responseBuilder  = responseBuilder;
     _controllerHelper = controllerHelper;
     _commandSender    = commandSender;
 }
        private IReadOnlyList <LdValue> FlushAndGetEvents(IResponseBuilder resp, IEventProcessor ep = null)
        {
            var req = FlushAndGetRequest(resp, ep);
            // annoyingly, req.Body is not provided by WireMock, only req.BodyAsJson
            var bodyStr = JsonConvert.SerializeObject(req.BodyAsJson);

            return(LdValue.Parse(bodyStr).AsList(LdValue.Convert.Json));
        }
Beispiel #28
0
 public TrackOrderOperation(ITrackOrderValidator validator, IControllerHelper controllerHelper, IResponseBuilder responseBuilder, ISettingsProvider settingsProvider, IUpsClient upsClient)
 {
     _validator        = validator;
     _controllerHelper = controllerHelper;
     _responseBuilder  = responseBuilder;
     _settingsProvider = settingsProvider;
     _upsClient        = upsClient;
 }
 public HomeAutomationCommunication(IRequestParser requestParser, IResponseBuilder responseBuilder, IConnectionHandler connectionHandler, IServiceLocator serviceLocator)
 {
     _requestParser       = requestParser;
     _responseBuilder     = responseBuilder;
     _requestHandlerTypes = GetRequestHandlerTypes();
     _connectionHandler   = connectionHandler;
     _serviceLocator      = serviceLocator;
 }
Beispiel #30
0
        public static IResponseBuilder WithRandomColor(this IResponseBuilder builder)
        {
            var _rnd     = new Random();
            var rndBytes = new byte[3];

            _rnd.NextBytes(rndBytes);
            return(builder.WithColor(new Color(rndBytes[0], rndBytes[1], rndBytes[2])));
        }
Beispiel #31
0
 public AppTokenAuthController(IResponseBuilder responseBuilder, ILogger logger, IHttpContextProxy httpContextProxy, IDBService dBService, IAppAuthTokenHandler appAuthTokenHandler)
     : base(httpContextProxy, dBService, logger, responseBuilder)
 {
     _responseBuilder     = responseBuilder;
     _httpContextProxy    = httpContextProxy;
     _logger              = logger;
     _appAuthTokenHandler = appAuthTokenHandler;
 }
Beispiel #32
0
 public TemplateEngineController(IResponseBuilder responseBuilder, IDBService dbService, ILogger logger, IHttpContextProxy httpContextProxy, IDBService dBService, IKeyValueStorage keyValueStorage, IStaticContentHandler staticContentHandler)
     : base(httpContextProxy, dBService, logger, responseBuilder)
 {
     _responseBuilder  = responseBuilder;
     _dbService        = dbService;
     _httpContextProxy = httpContextProxy;
     _logger           = logger;
 }
 public GetNotificationStatusOperation(INotificationRepository notificationRepository, IRequestBuilder requestBuilder,
                                       IResponseBuilder responseBuilder, IHalResponseBuilder halResponseBuilder)
 {
     _notificationRepository = notificationRepository;
     _requestBuilder         = requestBuilder;
     _responseBuilder        = responseBuilder;
     _halResponseBuilder     = halResponseBuilder;
 }
        public Response Construct(IRequest request)
        {
            _viewDirectory = Environment.GetEnvironmentVariable("ViewDirectory");
            var fullPath = _viewDirectory + FormPath;
            _responseBuilder = new ResponseBuilder(request);
            _responseBuilder.SetStatusCode(200);

            AddContentType();
            AddQuoteForm(fullPath);
            return _responseBuilder.Build();
        }
Beispiel #35
0
 private static void SetFileNotFound(IResponseBuilder responseBuilder)
 {
     responseBuilder.SetStatusCode(404);
 }
Beispiel #36
0
 private static void SetPreconditionFail(IResponseBuilder responseBuilder)
 {
     responseBuilder.SetStatusCode(412);
 }