private void ExpireAsync(ReservationExpiredMessage message) { var bus = BusPublisherStub.Create(); var service = new ReservationService(Db, bus); service.ExpireAsync(message).Wait(); }
private ShippingDto CreateShippingAsync(ShippingDtoMessage message) { var bus = BusPublisherStub.Create(); var service = new ProcessDtoService(Db, bus); service.CreateShippingAsync(message).Wait(); return(bus.DequeueExchange <ShippingDto>(ExchangeNames.DTO)); }
private ReservationExpiredMessage CheckDueAsync() { var bus = BusPublisherStub.Create(); var service = new ReservationService(Db, bus); service.CheckDueAsync().Wait(); return(bus.Dequeue <ReservationExpiredMessage>(QueueNames.Library)); }
private ReservationDtoMessage RequestAsync(ReservationMessage message) { var bus = BusPublisherStub.Create(); var service = new ReservationService(Db, bus); service.RequestAsync(message).Wait(); return(bus.Dequeue <ReservationDtoMessage>(QueueNames.Library)); }
private PagedResponse <BookProxy> GetByFilterAsync(PagedRequest <BookFilterPayload> pagination, Settings settings = null) { settings = settings ?? Settings.Empty; var config = ConfigurationStub.Create(() => { return(settings); }); var service = new BookService(Db, BusPublisherStub.Create(), config, TenantAccessorStub.Create()); return(service.GetByFilterAsync(pagination).GetAwaiter().GetResult()); }
private BookProxy GetByIdAsync(Guid id, Settings settings = null) { settings = settings ?? Settings.Empty; var config = ConfigurationStub.Create(() => { return(settings); }); var service = new BookService(Db, BusPublisherStub.Create(), config, TenantAccessorStub.Create()); return(service.GetByIdAsync(id).GetAwaiter().GetResult()); }
private BookUpdateMessage SaveAsync(BookMessage model, Settings settings = null) { settings = settings ?? Settings.Empty; var config = ConfigurationStub.Create(() => { return(settings); }); var bus = BusPublisherStub.Create(); var service = new BookService(Db, bus, config, TenantAccessorStub.Create()); service.SaveAsync(model).Wait(); return(bus.DequeueExchange <BookUpdateMessage>(ExchangeNames.Book)); }
private (ShippingDtoMessage Dto, DropCopyNumberMessage Proxy) CreateAsync(PurchaseMessage message, Settings settings = null) { settings = settings ?? Settings.Empty; var config = ConfigurationStub.Create(() => { return(settings); }); var bus = BusPublisherStub.Create(); var service = new PurchaseService(Db, bus, config, TenantAccessorStub.Create()); service.CreateAsync(message).Wait(); var drop = bus.Dequeue <DropCopyNumberMessage>(QueueNames.Library); var payload = bus.Dequeue <ShippingDtoMessage>(QueueNames.Bookstore); return(payload, drop); }
public PublishEventCommandHandlerTest() { MockRepository = new EfMockRepository <DbLibrary>(); Bus = BusPublisherStub.Create(); }
public PurchaseBookCommandHandlerTest() { MockRepository = new EfMockRepository <DbBookstore>(); Bus = BusPublisherStub.Create(); }
public ReserveBookCommandHandlerTest() { MockRepository = new EfMockRepository <DbLibrary>(); Bus = BusPublisherStub.Create(); }
public ExpireReservationCommandHandlerTest() { MockRepository = new EfMockRepository <DbLibrary>(); Bus = BusPublisherStub.Create(); }
private PagedResponse <ReservationProxy> GetByFilterAsync(PagedRequest <ReservationFilterPayload> pagination) { var service = new ReservationService(Db, BusPublisherStub.Create()); return(service.GetByFilterAsync(pagination).GetAwaiter().GetResult()); }
private void ReturnAsync(ReservationReturnMessage message) { var service = new ReservationService(Db, BusPublisherStub.Create()); service.ReturnAsync(message).Wait(); }
public SaveBookCommandHandlerTest() { MockRepository = new EfMockRepository <DbBook>(); Bus = BusPublisherStub.Create(); }