Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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);
        }