Пример #1
0
        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));
        }
Пример #2
0
 public async Task WhenANewOrderMessageArrivesIntoTheMessageQueue(Table table)
 {
     var orderMessage = table.CreateInstance <OrderMessage>();
     await _orderStreamSyncer.Sync(orderMessage);
 }