Esempio n. 1
0
        public void Can_Map_To_LoanRequest()
        {
            var businessLoans = new BusinessLoans
            {
                Id = 1,
                InterestRatePerAnnum = 0.05M,
                LoanAmount           = 100,
            };

            var expected = new LoansRequest
            {
                InterestRatePerAnnum = 0.05M,
                LoanAmount           = 100,
            };

            var sut = new BusinessLoanMapper();

            var result = sut.MapToLoanRequest(businessLoans);

            Assert.Equal(expected.InterestRatePerAnnum, result.InterestRatePerAnnum);
            Assert.Equal(expected.LoanAmount, result.LoanAmount);
        }
Esempio n. 2
0
        public bool IsSubmittedApplicationForBusinessLoansSuccess(
            BusinessLoans product, ISellerApplication application)
        {
            if (application?.CompanyData == null || application.Product == null || product == null)
            {
                return(false);
            }

            var result = _businessLoansService.SubmitApplicationFor(new CompanyDataRequestModel
            {
                CompanyFounded = application.CompanyData.Founded,
                CompanyNumber  = application.CompanyData.Number,
                CompanyName    = application.CompanyData.Name,
                DirectorName   = application.CompanyData.DirectorName
            }, new LoansRequestModel
            {
                InterestRatePerAnnum = product.InterestRatePerAnnum,
                LoanAmount           = product.LoanAmount
            });

            return(result.Success && result.ApplicationId.HasValue);
        }
Esempio n. 3
0
 public static LoansRequest Create(BusinessLoans loans) =>
 new LoansRequest
 {
     InterestRatePerAnnum = loans.InterestRatePerAnnum,
     LoanAmount           = loans.LoanAmount,
 };