public QuoteService(ILogger <QuoteService> logger, IConfiguration configuration, ILenderService lenderService, IRepaymentService repaymentService, IConditionService conditionService) { _logger = logger; _lenderService = lenderService; _repaymentService = repaymentService; _conditionService = conditionService; _repaymentLengthMonths = configuration.GetValue <int>("RepaymentLengthMonths"); }
public void GetMonthlyRepaymentAmount_CalculateAmount_ReturnValidAmount(int amountRequested, double interestRateDecimal, int repaymentLengthMonths, double expectedResult) { #region Arrange _repaymentService = new RepaymentService(_logger.Object); #endregion #region Act var result = _repaymentService.GetMonthlyRepaymentAmount(amountRequested, interestRateDecimal, repaymentLengthMonths); #endregion #region Assert Assert.That(result, Is.EqualTo(expectedResult)); #endregion }
public RepaymentController(IRepaymentService repaymentService) { _repaymentService = repaymentService; }
public RepaymentPresenter(IRepaymentView view, IRepaymentService repaymentService, ITranslationService translationService) { _view = view; _repaymentService = repaymentService; _translationService = translationService; }
RepaymantController() { // Replace this with IoC // Can Use TinyIoc, Unity, Ninject, Autofac etc paymentService = new RepaymentService(); }
public void TearDown() => _repaymentService = null;
public ShowRepaymentViewCommand(IRepaymentPresenter presenter, IRepaymentService service, IApplicationController appController) { _presenter = presenter; _service = service; _appController = appController; }
public RepaymentsController(ILogger <RepaymentsController> logger, IRepaymentService repaymentService) { _logger = logger; _repaymentService = repaymentService; }
public void SetUp() { this.paymentService = new RepaymentService(); }
public RepaymentTests() { var mockSeasons = new List <Season> { new Season { Id = 1, Name = "2017 Rainy", StartDate = new DateTime(2017, 01, 01) }, new Season { Id = 2, Name = "2018 Rainy", StartDate = new DateTime(2018, 01, 01) } }; var mockCustomers = new List <Customer> { new Customer { Id = 1, Name = "Kit Kat" }, new Customer { Id = 2, Name = "Ping Pong" }, new Customer { Id = 3, Name = "Yin Yang" } }; var mockCustomerSummaries = new List <CustomerSummary> { new CustomerSummary { CustomerId = 1, SeasonId = 1, TotalRepaid = 200, TotalCredit = 1000 }, new CustomerSummary { CustomerId = 1, SeasonId = 2, TotalRepaid = 700, TotalCredit = 1000 }, new CustomerSummary { CustomerId = 2, SeasonId = 1, TotalRepaid = 1200, TotalCredit = 1000 }, new CustomerSummary { CustomerId = 3, SeasonId = 1, TotalRepaid = 1000, TotalCredit = 1200 }, new CustomerSummary { CustomerId = 3, SeasonId = 2, TotalRepaid = 500, TotalCredit = 500 }, new CustomerSummary { CustomerId = 4, SeasonId = 1, TotalRepaid = 1000, TotalCredit = 1000 }, new CustomerSummary { CustomerId = 4, SeasonId = 2, TotalRepaid = 300, TotalCredit = 100 } }; var options = new DbContextOptionsBuilder <AppDbContext>() .UseInMemoryDatabase("SeasonServiceTestDb") .Options; _dbContext = new AppDbContext(options); _repaymentService = new RepaymentService(_dbContext, new BaseEntityRepository <Repayment>(_dbContext), new CustomerSummaryRepository(_dbContext), new BaseEntityRepository <RepaymentUpload>(_dbContext)); _dbContext.Customers.AddRange(mockCustomers); _dbContext.Seasons.AddRange(mockSeasons); _dbContext.CustomerSummaries.AddRange(mockCustomerSummaries); _dbContext.SaveChanges(); }