public ReceivableBookedConsumer(IUnitOfWork uow, IRequestBus requestBus) { Guard.NotNull(requestBus, nameof(requestBus)); Guard.NotNull(uow, nameof(uow)); this.uow = uow; this.requestBus = requestBus; }
public OrderCreatedConsumer(IUnitOfWork uow, IMessageBus requestBus) { Guard.NotNull(requestBus, nameof(requestBus)); Guard.NotNull(uow, nameof(uow)); this.uow = uow; this.requestBus = requestBus; }
public PairingCommand(IRequestBus requestBus, Device device) { this.device = device; this.requestBus = requestBus ?? throw new ArgumentNullException(nameof(requestBus)); device.PairingStatusChanged += HandlePairingStatusChanged; dispatcher = Dispatcher.CurrentDispatcher; }
public DevicesWindow() { InitializeComponent(); IContainer container = DependencyResolver.BuildContainer(); IRequestBus requestBus = container.Resolve <IRequestBus>(); IDeviceRepository deviceRepository = container.Resolve <IDeviceRepository>(); DataContext = new DevicesViewModel(deviceRepository, requestBus); }
public DevicesViewModel(IDeviceRepository deviceRepository, IRequestBus requestBus) { List <Device> devices = deviceRepository.GetAll(); Devices = devices .Select(x => { PairingCommand pairingCommand = new PairingCommand(requestBus, x); return(new DeviceViewModel(x, pairingCommand)); }) .ToList(); }
public void Setup() { var builder = new ContainerBuilder(); builder.RegisterModule <TestDataAccessReadModule>(); builder.RegisterModule <InfrastructureModule>(); builder.RegisterModule <ApplicationModule>(); builder.RegisterModule <TestDataAccessWriteModule>(); _container = builder.Build(); _requestBus = _container.Resolve <IRequestBus>(); _commandBus = _container.Resolve <ICommandBus>(); Given(); When(); }
public void PresentShowroomSection(ShowroomTestDataInput input, IRequestBus bus, IResponse <ShowroomViewModel> rsp) { var scope = Scope(); $"Given current tenant is {input.Tenant}" .x(c => scope.Using(c).SetCurrentTenant(input.Tenant)); $"And I have an instance of request bus" .x(() => bus = scope.RequestBus()); $"When I sent request for showroom view model" .x(async() => rsp = await bus.SendAsync <ShowroomRequest, ShowroomViewModel>(new ShowroomRequest())); $"Then I should receive a showroom view model response" .x(() => rsp.IsSucceed.ShouldBeTrue()); $"And view model should not be null" .x(() => rsp.Result.ShouldNotBeNull()); $"And view model title should be correct" .x(() => rsp.Result.Heading.ShouldBe(input.ExpectedViewModel.Heading)); $"And view model should have a link to view all" .x(() => rsp.Result.ViewAllLink.ShouldNotBeNull()); $"And view model view all link should have correct text" .x(() => rsp.Result.ViewAllLink.Text.ShouldBe(input.ExpectedViewModel.ViewAllLink.Text)); $"And view model view all link should have correct url" .x(() => rsp.Result.ViewAllLink.Url.ShouldBe(input.ExpectedViewModel.ViewAllLink.Url)); }
public static WidgetGroupResponse WidgetResponse <TRequest>(this IRequestBus bus, TRequest request) { var widgetsRsp = bus.Responses <TRequest, WidgetResponse>(request); return(BuildWidgetGroupResponse(widgetsRsp)); }
public UsersController(ICommandBus commandBus, IRequestBus requestBus) { _commandBus = commandBus; _requestBus = requestBus; }
public static async Task <UiOperationResult> RequestReceiveLog(ContextModel model, IRequestBus _socket, Action <object> _log) { System.Console.WriteLine("send model - Type: [" + typeof(ContextModel).Name + "]"); UiOperationResult uiResult = await _socket.RequestAsync(model); _log($"uiResult: [{uiResult.IsSuccess}] - ResultName: [{uiResult.ResultName}] - Amount: [{uiResult.ConfigurationModels?.Count}]\nError:[{uiResult.ErrorMessage}]"); System.Console.WriteLine("-".PadRight(50, '-')); return(uiResult); }
public DetailsController(IRequestBus bus, ISavedItemsProvider savedItemsProvider, ILogger logger) { this.bus = bus; this.savedItemsProvider = savedItemsProvider; this.logger = logger; }
public LoginController(IRequestBus bus) { _bus = bus; }
public HomeController(IRequestBus bus, ILogger logger) { this.bus = bus; this.logger = logger; }
public static async Task <WidgetGroupResponse> WidgetResponseAsync <TRequest>(this IRequestBus bus, TRequest request) { var widgetsRsp = await bus.ResponsesAsync <TRequest, WidgetResponse>(request); return(BuildWidgetGroupResponse(widgetsRsp)); }
public RegistrationController(IRequestBus bus) { _bus = bus; }
public DotnetConfigurationAdapter(IRequestBus rqBus) { _bus = rqBus; }
public ProductsController(IRequestBus bus) { _bus = bus; }