예제 #1
0
        public void OrderShouldbeApprovedAndEventShouldbePublished()
        {
            //Create Order
            var order = orderService.CreateOrder(orderDetails);

            Assert.IsNotNull(order.Id);
            AssertEvent <OrderCreatedEvent>();

            //Approve Order
            orderService.ApproveOrder(order.Id);
            AssertEvent <OrderApprovedEvent>();
        }
 public void Handle(IDomainEventEnvelope <CustomerCreditReservedEvent> customerCreditReservedEvent)
 {
     orderService.ApproveOrder(customerCreditReservedEvent.Event.orderId);
 }