public async Task Handle(QuoteRequestedEvent notification) { var quote = await _quoteRepository.FindById(notification.QuoteId); var modifier = _quotingCalculator.SelectPriceModifierRuleFor(quote.Customer); var basePriceRule = _quotingCalculator.SelectBasePriceRuleFor(quote.Vehicle); quote.CalculatePriceWithRules(await basePriceRule, await modifier); _quoteRepository.Update(quote); await _unitOfWork.SaveChangesAsync(); }
public void CalculateModifier_ShouldReturnAModifierByAgeRangeAndGender(Customer customer, IQuoteRulesCalculatorService calculator, PriceModifierRule modifier) { AssertValueObject(modifier, calculator.SelectPriceModifierRuleFor(customer).Result); }