Moq.Tests.Samples.IOrdersRepository.GetOutstandingOrders()

Here are the examples of the csharp api Moq.Tests.Samples.IOrdersRepository.GetOutstandingOrders() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : OrdersProcessor.cs
with Apache License 2.0
from adrianiftode

public async Task ProcessOutstandingOrders()
        {
            var outstandingOrders = await _ordersRepository.GetOutstandingOrders();
            foreach (var order in outstandingOrders)
            {
                try
                {
                    var paymentTransaction = await _paymentService.CompletePayment(order);
                    _logger.LogInformation("Order with {orderReference} was paid {at} by {customerEmail}, having {transactionId}", order.OrderReference, paymentTransaction.CreateOn, order.CustomerEmail, paymentTransaction.TransactionId);
                }
                catch (Exception e)
                {
                    _logger.LogWarning(e, "An exception occurred while completing the payment for {orderReference}", order.OrderReference);
                }
            }
            _logger.LogInformation("A batch of {0} outstanding orders was completed", outstandingOrders.Count);
        }