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();
        }
Example #2
0
        public static Quote WithDefaults()
        {
            var rate = RateBuilder.WithDefaults();

            var wedding = WeddingBuilder.WithDefaults(rate);

            return(new WeddingQuote((Email)"*****@*****.**", wedding, rate));
        }
Example #3
0
 public void RateCannotHaveValueOriginInvalid(double valueOriginInvalid)
 {
     Assert.Throws <ArgumentException>(() =>
                                       RateBuilder.New().WithValueOrigin(valueOriginInvalid).Build()
                                       ).WithMessage("Invalid source value currency");
 }
Example #4
0
 public void RateCannotHaveEmptyOrNullApiKey(string apiKeyInvalid)
 {
     Assert.Throws <ArgumentException>(() =>
                                       RateBuilder.New().WithApiKey(apiKeyInvalid).Build()
                                       ).WithMessage("Invalid ApiKey");
 }
Example #5
0
 public void RateCannotHaveFormatMessageInvalid(string formatMsgInvalid)
 {
     Assert.Throws <ArgumentException>(() =>
                                       RateBuilder.New().WithFormatMessage(formatMsgInvalid).Build()
                                       ).WithMessage("Invalid format message");
 }
Example #6
0
 public void RateCannotHaveEmptyOrNullCurrencyDestination(string currencyDestinationInvalid)
 {
     Assert.Throws <ArgumentException>(() =>
                                       RateBuilder.New().WithCurrencyDestination(currencyDestinationInvalid).Build()
                                       ).WithMessage("Invalid destination currency");
 }