예제 #1
0
        public void A_Welcome_Pack_Is_Not_Sent_To_The_Customer_After_Another_Account_Has_Been_Created()
        {
            var customerName = RandomName;
            var bus          = new FakeBus();

            using (var fixture = SagaFixture.For(() => new OnboardCustomerSaga(bus)))
            {
                fixture.Deliver(new OnboardCustomer {
                    CustomerName = customerName
                });
                fixture.Deliver(new CustomerAccountCreated {
                    CustomerName = RandomName
                });

                fixture.SagaDataShould(
                    have: x => !x.AccountCreated,
                    because: "it should not have reacted to the other customer's account being created");
                bus.HasNotSent <SendWelcomePackToCustomer>(
                    because: "it should initiate welcome pack creation because of another customer's account being created"
                    );

                fixture.ShouldNotHaveCompleted();
            }
        }