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)); }
public void RateCannotHaveValueOriginInvalid(double valueOriginInvalid) { Assert.Throws <ArgumentException>(() => RateBuilder.New().WithValueOrigin(valueOriginInvalid).Build() ).WithMessage("Invalid source value currency"); }
public void RateCannotHaveEmptyOrNullApiKey(string apiKeyInvalid) { Assert.Throws <ArgumentException>(() => RateBuilder.New().WithApiKey(apiKeyInvalid).Build() ).WithMessage("Invalid ApiKey"); }
public void RateCannotHaveFormatMessageInvalid(string formatMsgInvalid) { Assert.Throws <ArgumentException>(() => RateBuilder.New().WithFormatMessage(formatMsgInvalid).Build() ).WithMessage("Invalid format message"); }
public void RateCannotHaveEmptyOrNullCurrencyDestination(string currencyDestinationInvalid) { Assert.Throws <ArgumentException>(() => RateBuilder.New().WithCurrencyDestination(currencyDestinationInvalid).Build() ).WithMessage("Invalid destination currency"); }