Exemple #1
0
 public void Approve(LoanRequest loanRequest)
 {
     if (loanRequest.LoanAmount <= MaxLoanApprovedAmount && loanRequest.PreviousRecord)
     {
         loanRequest.Approved   = true;
         loanRequest.ApprovedBy = this;
     }
 }
Exemple #2
0
 public void Approve(LoanRequest loanRequest)
 {
     if (loanRequest.LoanAmount <= MaxLoanApprovedAmount)
     {
         loanRequest.Approved   = true;
         loanRequest.ApprovedBy = this;
     }
     nextLoanApprover.Approve(loanRequest);
 }
Exemple #3
0
        public void ShouldApproveLoanAmount()
        {
            var loanExecutive = new LoanExecutive();

            LoanRequest loanRequest1 = loanExecutive.RequestForLoanApprove("123", false, 100);
            LoanRequest loanRequest2 = loanExecutive.RequestForLoanApprove("234", true, 100000);

            loanRequest1.Approved.Should().BeTrue();
            loanRequest1.ApprovedBy.GetApproverId().Should().NotBeNullOrEmpty();

            loanRequest2.Approved.Should().BeTrue();
            loanRequest2.ApprovedBy.GetApproverId().Should().NotBeNullOrEmpty();
        }
Exemple #4
0
        public LoanRequest RequestForLoanApprove(string nationaId, bool previousRecordGood, int loanAmount)
        {
            var loanRequest = new LoanRequest
            {
                NationalId     = nationaId,
                PreviousRecord = previousRecordGood,
                LoanAmount     = loanAmount
            };
            ILoanApprover loanApprover = new BranchManagerApprover("Mr. X");

            loanApprover.Approve(loanRequest);
            return(loanRequest);
        }