public void Approve(LoanRequest loanRequest) { if (loanRequest.LoanAmount <= MaxLoanApprovedAmount && loanRequest.PreviousRecord) { loanRequest.Approved = true; loanRequest.ApprovedBy = this; } }
public void Approve(LoanRequest loanRequest) { if (loanRequest.LoanAmount <= MaxLoanApprovedAmount) { loanRequest.Approved = true; loanRequest.ApprovedBy = this; } nextLoanApprover.Approve(loanRequest); }
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(); }
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); }