public override void Given() { request = new LoanRequest { Customer = new Customer { CreditScore = 10, GoldCustomer = true }, Value = 9000 }; }
public Either <LoanDeclinedReason, LoanRequest> CheckSillyAmount(LoanRequest request) { if (request.Value > 1000000) { return(Either.Left(LoanDeclinedReason.LoanRequestTooHigh)); } return(Either.Right(request)); }
//here are some business rules public Either <LoanDeclinedReason, LoanRequest> CheckCustomerCredit(LoanRequest request) { if (request.Customer.CreditScore > 8) { return(Either.Right(request)); } return(Either.Left(LoanDeclinedReason.InsufficientCreditScore)); }
public Either<LoanDeclinedReason, LoanRequest> CheckGoldPrerequisiteCustomer(LoanRequest request) { if (request.Value < 10000) return Either.Right(request); //dont need gold status for less than 10,000 if (request.Customer.GoldCustomer) return Either.Right(request); return Either.Left(LoanDeclinedReason.RequiresGoldCustomer); }
//here are some business rules public Either<LoanDeclinedReason, LoanRequest> CheckCustomerCredit(LoanRequest request) { if (request.Customer.CreditScore > 8) return Either.Right(request); return Either.Left(LoanDeclinedReason.InsufficientCreditScore); }
public Either<LoanDeclinedReason, LoanRequest> CheckSillyAmount(LoanRequest request) { if (request.Value > 1000000) return Either.Left(LoanDeclinedReason.LoanRequestTooHigh); return Either.Right(request); }
public Either <LoanDeclinedReason, LoanRequest> CheckGoldPrerequisiteCustomer(LoanRequest request) { if (request.Value < 10000) { return(Either.Right(request)); //dont need gold status for less than 10,000 } if (request.Customer.GoldCustomer) { return(Either.Right(request)); } return(Either.Left(LoanDeclinedReason.RequiresGoldCustomer)); }