public void The_Systems_Track_The_Ola_For_Customer_Onboarding() { var customerName = RandomName; var bus = new FakeBus(); using (var fixture = SagaFixture.For(() => new OnboardCustomerSaga(bus))) { fixture.Deliver(new OnboardCustomer { CustomerName = customerName }); bus.HasDeferredLocal <VerifyCustomerOnboardingOla>( with: x => x.CustomerName == customerName, because: "it should start tracking the OLA"); } }
public void If_The_Ola_Is_Breached_Then_Other_Systems_Will_Not_Be_Notified_About_The_Onboarding() { var customerName = RandomName; var bus = new FakeBus(); using (var fixture = SagaFixture.For(() => new OnboardCustomerSaga(bus))) { fixture.Deliver(new OnboardCustomer { CustomerName = customerName }); bus.HasDeferredLocal <VerifyCustomerOnboardingOla>( with: x => x.CustomerName == customerName, because: "it should start tracking the OLA"); fixture.Deliver(new VerifyCustomerOnboardingOla { CustomerName = customerName }); fixture.ShouldHaveCompleted(); bus.HasNotPublished <CustomerOnboarded>(because: "the saga was not successful and there should be no event notifying of a customer onboarding"); } }
public void If_The_Ola_Is_Breached_Then_The_Service_Desk_Takes_Over_The_Process() { var customerName = RandomName; var bus = new FakeBus(); using (var fixture = SagaFixture.For(() => new OnboardCustomerSaga(bus))) { fixture.Deliver(new OnboardCustomer { CustomerName = customerName }); bus.HasDeferredLocal <VerifyCustomerOnboardingOla>( with: x => x.CustomerName == customerName, because: "it should start tracking the OLA"); fixture.Deliver(new VerifyCustomerOnboardingOla { CustomerName = customerName }); fixture.ShouldHaveCompleted(); bus.HasSentLocal <CustomerOnboardingOlaBreached>( with: x => x.CustomerName == customerName, because: "the service desk should be notified of the failed onboarding"); } }