public async System.Threading.Tasks.Task Should_CreateALeadProfieUponCreationOfQuoteGivenUserDoesntExist() { var email = (Email)"*****@*****.**"; var rate = RateBuilder.WithDefaults(); var wedding = WeddingBuilder.WithDefaults(rate); var quote = new WeddingQuote(email, wedding, rate); var eventStore = new EventStoreBuilder().Build(); var context = new DblDipDbContextBuilder() .Add(rate) .Add(wedding) .Add(quote) .SaveChanges() .Build(); var sut = new QuoteCreatedSaga(context, eventStore); await sut.Handle(new QuoteCreated(quote), default); var user = context.Set <User>().Where(x => x.Username == email).Single(); }
public static Quote WithDefaults() { var rate = RateBuilder.WithDefaults(); var wedding = WeddingBuilder.WithDefaults(rate); return(new WeddingQuote((Email)"*****@*****.**", wedding, rate)); }