コード例 #1
0
ファイル: SagaTests.cs プロジェクト: seankearon/rebus-demo
        public void If_The_Ola_Is_Breached_Then_And_No_Sales_Call_Was_Placed_Then_No_Cancellation_Takes_Place()
        {
            var customerName = RandomName;
            var bus          = new FakeBus();

            using (var fixture = SagaFixture.For(() => new OnboardCustomerSaga(bus)))
            {
                fixture.Deliver(new OnboardCustomer {
                    CustomerName = customerName
                });
                bus.HasNotSentLocal <ScheduleASalesCall>(
                    because: "the account creation is has not been confirmed");

                fixture.Deliver(new VerifyCustomerOnboardingOla {
                    CustomerName = customerName
                });

                fixture.ShouldHaveCompleted();
                bus.HasNotSentLocal <CancellSalesCall>(
                    because: "the  sales call is only cancelled after an OLA breach if it has already been requested");
            }
        }