public void Handle_PlaceOrderReceived_TimeoutShouldBeSet() { Test.Initialize(); var placeOrder = new PlaceOrder { OrderId = 1 }; Test.Saga<ByersRemorse>() .ExpectTimeoutToBeSetIn<PlaceOrder>((state, span)=> span == TimeSpan.FromSeconds(10)) .When(saga => saga.Handle(placeOrder)); }
public void Handle_TimeoutReachedForOrderReceived_OrderAcceptedPublished() { Test.Initialize(); var state = new PlaceOrder{OrderId = 1}; Test.Saga<ByersRemorse>() .ExpectPublish<OrderAccepted>(m => m.OrderId == 1) .When(saga => saga.Timeout(state)); }
public void Handle_PlaceOrderReceived_OrderReceivedPublished() { Test.Initialize(); var placeOrder = new PlaceOrder{OrderId = 1}; Test.Saga<ByersRemorse>() .ExpectPublish<OrderReceived>(orderReceived => orderReceived.OrderId == 1) .When(saga => saga.Handle(placeOrder)); }
public void Run() { var placeOrder = new PlaceOrder {OrderId = 1}; Bus.SendLocal(placeOrder); // Console.ReadLine(); //var cancelOrder = new CancelOrder {OrderId = 1}; //Bus.SendLocal(cancelOrder); }