public void Test_CalculateLoan_ShouldReturnCorrectRate(LoanDTO loanDTO)
        {
            Loan loan = carLoanCalculator.CalculateLoan(loanDTO);

            Assert.NotNull(loan);
            Assert.InRange(loan.InterestRate, 8, 12);
        }
예제 #2
0
        public void Test_CalculateLoan_ShouldReturnLoan()
        {
            // first scenario
            LoanDTO loanDTO1 = new LoanDTO();

            loanDTO1.LoanType     = LoanType.CarLoan;
            loanDTO1.LocationType = LocationType.Location1;
            loanDTO1.JobType      = JobType.Professional;
            Loan loan1 = carLoanCalculator.CalculateLoan(loanDTO1);

            Assert.NotNull(loan1);
            Assert.Equal(8, loan1.InterestRate);
            // second scenario
            LoanDTO loanDTO2 = new LoanDTO();

            loanDTO2.LoanType     = LoanType.CarLoan;
            loanDTO2.LocationType = LocationType.Location2;
            loanDTO2.JobType      = JobType.Professional;
            Loan loan2 = carLoanCalculator.CalculateLoan(loanDTO2);

            Assert.NotNull(loan2);
            Assert.Equal(10, loan2.InterestRate);
        }