示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
        public void Run()
        {
            var placeOrder = new PlaceOrder {OrderId = 1};
            Bus.SendLocal(placeOrder);

              //  Console.ReadLine();

            //var cancelOrder = new CancelOrder {OrderId = 1};
            //Bus.SendLocal(cancelOrder);
        }