Exemplo n.º 1
0
        public async Task Order_Should_Be_Completed()
        {
            // Arrange
            await Order_Should_Be_Created();

            Guid orderId = Guid.Empty;

            UsingDbContext(db =>
            {
                var order = db.Orders.First();
                order.OrderStatus.ShouldNotBe(OrderStatus.Completed);
                order.CompletionTime.ShouldBeNull();
                orderId = order.Id;
                order.SetPaidTime(DateTime.Now);
                order.SetReducedInventoryAfterPaymentTime(DateTime.Now);
                db.SaveChanges();
            });

            // Act
            var response = await _orderAppService.CompleteAsync(orderId);

            // Assert
            response.ShouldNotBeNull();
            response.Id.ShouldBe(orderId);
            response.OrderStatus.ShouldBe(OrderStatus.Completed);
        }
Exemplo n.º 2
0
 public Task <OrderDto> CompleteAsync(CompleteOrderInput input)
 {
     return(_service.CompleteAsync(input));
 }
Exemplo n.º 3
0
 public Task <OrderDto> CompleteAsync(Guid id)
 {
     return(_service.CompleteAsync(id));
 }