public async Task PersistOrderToDatabase(string salesChannel, int salesChannelId) { OrderMessage orderMessage = new OrderMessage { SalesChannel = salesChannel }; var backOfficeOrder = new BackOfficeOrder(); _salesChannelIdQueryMock.Setup(p => p.GetIdBy(salesChannel)) .ReturnsAsync(salesChannelId); _backOfficeOrderFactoryMock.Setup(p => p.InstantiateFrom(orderMessage, salesChannelId)) .Returns(backOfficeOrder); await _orderStreamSyncer.Sync(orderMessage); _orderPersisterMock.Verify(p => p.Persist(backOfficeOrder)); }
public async Task WhenANewOrderMessageArrivesIntoTheMessageQueue(Table table) { var orderMessage = table.CreateInstance <OrderMessage>(); await _orderStreamSyncer.Sync(orderMessage); }