public override void Given()
 {
     request = new LoanRequest {
             Customer = new Customer { CreditScore = 10, GoldCustomer = true },
             Value = 9000
         };
 }
Ejemplo n.º 2
0
 public Either <LoanDeclinedReason, LoanRequest> CheckSillyAmount(LoanRequest request)
 {
     if (request.Value > 1000000)
     {
         return(Either.Left(LoanDeclinedReason.LoanRequestTooHigh));
     }
     return(Either.Right(request));
 }
Ejemplo n.º 3
0
 //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));
 }
Ejemplo n.º 4
0
 public override void Given()
 {
     request = new LoanRequest {
         Customer = new Customer {
             CreditScore = 10, GoldCustomer = true
         },
         Value = 9000
     };
 }
 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);
 }
Ejemplo n.º 8
0
 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));
 }