first commit
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Xunit;
|
||||
using Landmark.OLA.Models.Loan;
|
||||
using Landmark.OLA.Models.Loan.Enums;
|
||||
using Landmark.OLA.Models.Loan.Validators;
|
||||
|
||||
namespace Landmark.OLA.Tests.Loan.Enums
|
||||
{
|
||||
//Check that all Loan Types are included in various settings
|
||||
|
||||
public class LoanTypeTest
|
||||
{
|
||||
private static List<LoanType> GetLoanTypes()
|
||||
{
|
||||
return [.. Enum.GetValues(typeof(LoanType))
|
||||
.Cast<LoanType>()
|
||||
.Where(e => !e.ToString().StartsWith("CC_"))];
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TermLengthCheck()
|
||||
{
|
||||
_ = new LoanApplicationValidator();
|
||||
|
||||
foreach (var loanType in GetLoanTypes())
|
||||
{
|
||||
switch (loanType)
|
||||
{
|
||||
case LoanType.EQ_Mtg_Refi_Express:
|
||||
Assert.NotEmpty(TermLengths.MortgageRefiExpress);
|
||||
break;
|
||||
case LoanType.EQ_Home_Equity_Fixed:
|
||||
Assert.NotEmpty(TermLengths.HomeEquity);
|
||||
break;
|
||||
case LoanType.V_Vehicle:
|
||||
case LoanType.V_VehiclePreapproval:
|
||||
Assert.NotEmpty(TermLengths.TermsByYear);
|
||||
break;
|
||||
case LoanType.EQ_Mfg_Home_With_or_Without_Land:
|
||||
case LoanType.T_TrailerMotorhome:
|
||||
Assert.NotEmpty(TermLengths.MfdHomeAndRvByAmount);
|
||||
break;
|
||||
case LoanType.M_Boat:
|
||||
Assert.NotEmpty(TermLengths.BoatLoansByAmount);
|
||||
break;
|
||||
case LoanType.P_Powersport:
|
||||
Assert.NotEmpty(TermLengths.PowersportByAmount);
|
||||
break;
|
||||
case LoanType.S_Signature:
|
||||
Assert.NotEmpty(TermLengths.SignatureByAmount);
|
||||
break;
|
||||
case LoanType.S_Special:
|
||||
Assert.NotEmpty(TermLengths.Special);
|
||||
break;
|
||||
default:
|
||||
Assert.False(LoanApplicationValidator.IsTermRequired(loanType),
|
||||
$"{loanType} does not have any term lengths or is not excluded from the test.");
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PurposeCheck()
|
||||
{
|
||||
foreach (var loanType in GetLoanTypes())
|
||||
{
|
||||
Assert.True(LoanPurpose.TypePurposes.ContainsKey(loanType), $"{loanType} does not have any set purposes.");
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LimitCheck()
|
||||
{
|
||||
foreach (var loanType in GetLoanTypes())
|
||||
{
|
||||
Assert.True(LoanLimits.Limits.ContainsKey(loanType), $"{loanType} does not have a set limit.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user