first commit

This commit is contained in:
Zeeshaun
2026-03-11 11:18:25 -05:00
commit f3cb730f3b
472 changed files with 53651 additions and 0 deletions
@@ -0,0 +1,35 @@
using System;
using Xunit;
using CRIF.ACTion.Loan;
using Landmark.OLA.Models.Loan;
using Landmark.OLA.Models.Loan.Enums;
namespace CRIF.ACTion.Tests.Loan
{
public class AppDetailBankcardSectionTest
{
[Fact]
public void SetAsStudentCcProduct()
{
var section = new AppDetailBankcardSection("", TestCommon.GetTestSettings());
var loanApplication = new LoanApplication
{
LoanType = LoanType.CC_Student,
Purpose = LoanPurpose.Purpose.Other,
RequestedAmount = 100,
PrimaryContactMethod = "1234567890"
};
section.SetDetails(loanApplication, channelRef: new Guid("8066fa2a-16ba-4148-b28c-2926ba263c5f"));
var cashBackCcElement = section.Build();
var result = TestCommon.Compare(cashBackCcElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AppDetailsSection"
+ System.IO.Path.DirectorySeparatorChar + "SetAsStudentCcProduct.xml");
Assert.Empty(result);
}
}
}
@@ -0,0 +1,35 @@
using System;
using System.Text;
using Xunit;
using CRIF.ACTion.Files;
using Landmark.OLA.Models.Loan;
namespace CRIF.ACTion.Tests.Loan
{
public class FileRequestBuilderTest
{
private readonly LoanApplicationFile appFile = new LoanApplicationFile("12345", new Guid("b734f50d-d83e-41e9-af19-7291d9cc0622"), "test.txt", "test", "0", "Proof of Income");
private readonly string fileBase64Value = Convert.ToBase64String(Encoding.ASCII.GetBytes("test"));
[Fact]
public void Validate()
{
var createAppElement = new FileRequestBuilder("12345", appFile, fileBase64Value, TestCommon.GetTestSettings()).Build();
Assert.Empty(TestCommon.Validate(createAppElement));
}
[Fact]
public void CompareFileRequestXML()
{
var createAppElement = new FileRequestBuilder("12345", appFile, fileBase64Value, TestCommon.GetTestSettings()).Build();
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AddAppFilesSection" + System.IO.Path.DirectorySeparatorChar + "AddAppFiles.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
}
}
@@ -0,0 +1,141 @@
using System;
using System.Collections.Generic;
using Xunit;
using CRIF.ACTion.Loan;
using Landmark.OLA.Models.Addresses;
using Landmark.OLA.Models.Addresses.Enums;
using Landmark.OLA.Models.Assets;
using Landmark.OLA.Models.Assets.Enums;
using Landmark.OLA.Models.HomeMortgageDisclosureAct;
using Landmark.OLA.Models.Individuals;
using Landmark.OLA.Models.Individuals.Enums;
using Landmark.OLA.Models.Loan;
using Landmark.OLA.Models.Loan.Enums;
using Landmark.OLA.Models.Residences;
namespace CRIF.ACTion.Tests.Loan
{
public class HelocFlexTest
{
private readonly LoanApplication _loanApplication =
new(loanDate: DateTime.Parse("2018-01-01T06:00:00.0000000Z", null, System.Globalization.DateTimeStyles.AssumeLocal), loanId: "7c0d9659-4d37-4ae7-93ce-e6c72ad6a0b5")
{
LoanType = LoanType.EQ_HELOC_Flex,
Purpose = LoanPurpose.Purpose.Purchase,
RequestedAmount = 1000,
PrimaryContactMethod = "1234567890",
DisclosureDate = DateTime.Parse("2019-03-08T19:50:26.429Z"),
IPAddress = "111.11.1111",
RealEstate = new RealEstate(realEstateId: new Guid("7c0d9659-4d37-4ae7-93ce-e6c72ad6a0b5"))
{
LienPosition = new LienPosition
{
HasFirstMortgage = true,
HasSecondMortgage = true,
PayoffFirstMortgage = false,
PayoffSecondMortgage = true
},
CurrentlyBeingRemodeledOrImproved = false,
CurrentlyListedForSale = false,
InitialEstimatedValue = 250000m,
Type = RealEstateType.SingleFamily,
Use = PropertyUse.OwnerOccupied,
RealEstateAddress = new Address(new Guid("f370b54c-5999-4ebc-b1b6-078cc8571652"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
},
},
PrimaryBorrower = new Individual(new Guid("b0fb7c37-a203-4c06-89cb-e4e9f3ca20d4"))
{
Language = LanguageOption.English,
FirstName = "Jane",
MiddleInitial = "J",
LastName = "Doe",
DOB = new DateTime(2018, 01, 01),
SSN = "666666666",
Phone = "5555550100",
PhoneType = PhoneType.Home,
Email = "[email protected]",
IsMarried = false,
Address = new CurrentResidenceAddress(new Guid("66eecd56-4877-47d9-b2b1-45d11a087322"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
MonthlyPayment = 1000m,
MonthsResided = 120,
ResidenceType = ResidenceTypeOption.Own,
},
HmdaValues = new Hmda
{
HmdaNoticeDisclosed = true,
Races =
[
Race.NotProvided,
],
Ethnicities =
[
Ethnicity.OtherHispanicLatino,
],
OtherHispanicLatinoEthnicity = "Argentinean",
Sexes =
[
Sex.Female,
Sex.Male,
],
},
Employers =
[
new Employer(employerId: new Guid("57df49cc-ff09-4660-aa47-54fdb5e08017"))
{
Language = LanguageOption.English,
Name = "Purple Widgets Inc",
CurrentEmployer = true,
EmploymentType = EmploymentTypeOption.FullTime,
MonthsEmployed = 120,
StartDate = new DateTime(2008, 01, 01),
EndDate = new DateTime(2018,01,01),
Title = "Lead Widget Painter",
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Job",
AmountPerPeriod = 100m,
Frequency = Frequency.Hourly,
IncomeStatus = IncomeStatus.IncomeStatus_Included,
},
},
],
}
};
[Fact]
public void Validate()
{
var createAppElement = new LoanApplicationRequestBuilder(_loanApplication, TestCommon.GetTestSettings()).Build();
Assert.Empty(TestCommon.Validate(createAppElement));
}
[Fact]
public void CreateApplication()
{
var createAppElement = new LoanApplicationRequestBuilder(_loanApplication, TestCommon.GetTestSettings(),
new Guid("741be6b4-9f42-4efd-871f-f5d99c0ef122"), new Guid("e814d860-14fe-4bef-be9b-21be3dce1edf"),
new Guid("3090a5a1-d493-4865-ba44-8fd390dfec44"), new TestDistributionChannelLookupService()).Build();
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "HelocFlex" + System.IO.Path.DirectorySeparatorChar + "CreateApplication.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
}
}
@@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Linq;
using Org.XmlUnit.Diff;
using Xunit;
using CRIF.ACTion.Common.Parsers;
using CRIF.ACTion.Loan.Individuals;
using Landmark.OLA.Models.Addresses.Enums;
using Landmark.OLA.Models.Individuals;
using Landmark.OLA.Models.Individuals.Enums;
using Landmark.OLA.Models.Residences;
namespace CRIF.ACTion.Tests.Loan.Individuals
{
public class AddIndividualResponseParserTest
{
private readonly IResponseParser<Individual> IndividualParser;
private readonly int applicationId = 1100950;
public AddIndividualResponseParserTest()
{
IndividualParser = new AddIndividualResponseParser();
}
private readonly Individual individual = new(new Guid("325f9caf-b08a-44dc-af67-bd49db6a822c"))
{
FirstName = "Jane",
MiddleInitial = "A",
LastName = "Doe",
DOB = new DateTime(2018, 7, 9),
Phone = "1235555555",
PhoneType = PhoneType.Home,
SSN = "000090001",
Email = "[email protected]",
IsMarried = false,
Language = LanguageOption.English,
HasOptedOutTCPA = true,
Address = new CurrentResidenceAddress(new Guid("325f9caf-b08a-44dc-af67-bd49db6a822c"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
PostalCode = "53151",
Country = CountryOption.UnitedStates,
MonthsResided = 12,
ResidenceType = ResidenceTypeOption.Own,
MonthlyPayment = 100,
},
};
[Fact]
public void ErrorResponseParse()
{
XmlDocument doc = new();
doc.Load("ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AddIndividualError.xml");
XDocument response;
using (XmlNodeReader reader = new(doc))
{
response = XDocument.Load(reader);
}
Exception ex = Assert.Throws<Exception>(() => IndividualParser.Parse(response.Root));
Assert.Equal("The 'Common:isCollateralGrantorFL' attribute is not declared. on line 1 position 166", ex.Message);
}
[Fact]
public void SuccessResponseParse()
{
XmlDocument doc = new();
doc.Load("ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AddIndividualSuccess.xml");
XDocument response;
using (XmlNodeReader reader = new(doc))
{
response = XDocument.Load(reader);
}
var parsedIndividual = IndividualParser.Parse(response.Root);
Assert.Equal("Jane", parsedIndividual.FirstName);
}
[Fact]
public void Validate()
{
var addIndividual =
new AddIndividualRequestBuilder(applicationId.ToString(), individual, TestCommon.GetTestSettings()).Build();
Assert.Empty(TestCommon.Validate(addIndividual));
}
[Fact]
public void CorrectBuild()
{
var addIndividual =
new AddIndividualRequestBuilder(applicationId.ToString(), individual, TestCommon.GetTestSettings()).Build();
var result = TestCommon.Compare(addIndividual,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AddIndividual-Simple.xml");
Assert.Empty(result);
}
[Fact]
public void BadNamespace()
{
var addIndividual =
new AddIndividualRequestBuilder(applicationId.ToString(), individual, TestCommon.GetTestSettings()).Build();
var result = TestCommon.Compare(addIndividual,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AddIndividual-BadNamespace.xml");
Assert.NotEmpty(result);
}
}
}
@@ -0,0 +1,40 @@
using System;
using Xunit;
using CRIF.ACTion.Common;
using CRIF.ACTion.Loan.Individuals;
using Landmark.OLA.Models.Addresses.Enums;
using Landmark.OLA.Models.Residences;
namespace CRIF.ACTion.Tests.Loan.Individuals
{
public class AddressesSectionTest
{
public ResidenceAddress ValidAddress = new(new Guid("a333a064-be7b-4d20-841f-9c3c306866b3"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
MonthsResided = 12,
ResidenceType = ResidenceTypeOption.Own,
};
[Fact]
public void AddAddress()
{
var section = new AddressesSection("", TestCommon.GetTestSettings());
section.AddAddress(ValidAddress, ContactMechanisms.CrifContactMechanism.CurrentAddress);
var addressElement = section.Build();
var result = TestCommon.Compare(addressElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AddressesSection"
+ System.IO.Path.DirectorySeparatorChar + "AddAddress.xml");
Assert.Empty(result);
}
}
}
@@ -0,0 +1,215 @@
using System;
using System.Collections.Generic;
using Xunit;
using CRIF.ACTion.Loan.Individuals;
using Landmark.OLA.Models.Addresses.Enums;
using Landmark.OLA.Models.Individuals;
using Landmark.OLA.Models.Individuals.Enums;
using Landmark.OLA.Models.Residences;
namespace CRIF.ACTion.Tests.Loan.Individuals
{
public class AppPartiesSectionTest
{
private static Guid TestGuid => new("a333a064-be7b-4d20-841f-9c3c306866b3");
private readonly Individual Individual = new(new Guid("3580f8c9-db39-42f9-a9f3-133fe4a3b002"))
{
FirstName = "Jane",
MiddleInitial = "A",
LastName = "Doe",
DOB = new DateTime(2018, 7, 9),
Phone = "1235555555",
PhoneType = PhoneType.Home,
SSN = "000090001",
Email = "[email protected]",
IsMarried = false,
Address = new CurrentResidenceAddress
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
PostalCode = "53151",
MonthsResided = 12,
ResidenceType = ResidenceTypeOption.Own,
MonthlyPayment = 100,
},
OtherIncomes =
[
new Income
{
IncomeTypeCD = IncomeType.Alimony,
SourceName = "Child Support",
AmountPerPeriod = 500.0m,
Frequency = Frequency.Annually,
IncomeStatus = IncomeStatus.IncomeStatus_Included
}
],
Employers =
[
new Employer
{
Name = "College Pro Painters",
Title = "tester",
WorkPhone = "9992245555",
MonthsEmployed = 60,
CurrentEmployer = true,
EmploymentType = EmploymentTypeOption.FullTime,
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Salary",
AmountPerPeriod = 5000.0m,
Frequency = Frequency.Annually,
IncomeStatus = IncomeStatus.IncomeStatus_Included
}
}
]
};
private readonly IIndividualHistory HistoryIndividual = new HistoryIndividual(new Guid("3580f8c9-db39-42f9-a9f3-133fe4a3b002"))
{
FirstName = "Jane",
MiddleInitial = "A",
LastName = "Doe",
DOB = new DateTime(2018, 7, 9),
Phone = "1235555555",
PhoneType = PhoneType.Home,
SSN = "000090001",
Email = "[email protected]",
Address = new CurrentResidenceAddress
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
PostalCode = "53151",
MonthsResided = 12,
ResidenceType = ResidenceTypeOption.Own,
MonthlyPayment = 100,
},
OtherIncomes =
[
new Income
{
IncomeTypeCD = IncomeType.Alimony,
SourceName = "Child Support",
AmountPerPeriod = 500.0m,
Frequency = Frequency.Annually,
IncomeStatus = IncomeStatus.IncomeStatus_Included
}
],
};
[Fact]
public void AddIndividualBorrowerParty()
{
var section = new AppPartiesSection("", TestCommon.GetTestSettings());
section.AddIndividualParty(Individual, AppPartiesSection.PartyType.borrower, false);
var partyElement = section.Build();
var result = TestCommon.Compare(partyElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AppPartiesSection"
+ System.IO.Path.DirectorySeparatorChar + "AddIndividualBorrowerParty.xml");
Assert.Empty(result);
}
[Fact]
public void AddIndividualNonSigningPrimarySpouseParty()
{
var section = new AppPartiesSection("", TestCommon.GetTestSettings());
section.AddIndividualParty(HistoryIndividual, AppPartiesSection.PartyType.NonSigningSpouseMarriedToPrimary);
var partyElement = section.Build();
var result = TestCommon.Compare(partyElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AppPartiesSection"
+ System.IO.Path.DirectorySeparatorChar + "AddIndividualNonSigningPrimarySpouseParty.xml");
Assert.Empty(result);
}
[Fact]
public void AddIndividualNonSigningCoApplicantSpouseParty()
{
var section = new AppPartiesSection("", TestCommon.GetTestSettings());
section.AddIndividualParty(HistoryIndividual, AppPartiesSection.PartyType.NonSigningSpouseMarriedToCoBorrower);
var partyElement = section.Build();
var result = TestCommon.Compare(partyElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AppPartiesSection"
+ System.IO.Path.DirectorySeparatorChar + "AddIndividualNonSigningCoApplicantSpouseParty.xml");
Assert.Empty(result);
}
[Fact]
public void AddRentAndAlimony()
{
var section = new AppPartiesSection("", TestCommon.GetTestSettings());
section.AddIndividualParty(Individual, AppPartiesSection.PartyType.borrower);
var partyElement = section.Build();
var result = TestCommon.Compare(partyElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AppPartiesSection"
+ System.IO.Path.DirectorySeparatorChar + "AddIndividualBorrowerParty.xml");
Assert.Empty(result);
}
[Fact]
public void AddIndividualPrimaryBorrowerParty()
{
var section = new AppPartiesSection("", TestCommon.GetTestSettings());
section.AddIndividualParty(Individual, AppPartiesSection.PartyType.primaryBorrower);
var partyElement = section.Build();
var result = TestCommon.Compare(partyElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AppPartiesSection"
+ System.IO.Path.DirectorySeparatorChar + "AddIndividualPrimaryBorrowerParty.xml");
Assert.Empty(result);
}
[Fact]
public void SetSourceChannel()
{
var section = new AppPartiesSection("", TestCommon.GetTestSettings());
section.SetSourceChannel(TestGuid);
var partyElement = section.Build();
var result = TestCommon.Compare(partyElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AppPartiesSection"
+ System.IO.Path.DirectorySeparatorChar + "SetSourceChannel.xml");
Assert.Empty(result);
}
[Fact]
public void SetServicingChannel()
{
var section = new AppPartiesSection("", TestCommon.GetTestSettings());
section.SetServicingChannel(TestGuid);
var partyElement = section.Build();
var result = TestCommon.Compare(partyElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "AppPartiesSection"
+ System.IO.Path.DirectorySeparatorChar + "SetServicingChannel.xml");
Assert.Empty(result);
}
}
}
@@ -0,0 +1,50 @@
using System;
using System.Xml.Linq;
using Xunit;
using Xunit.Abstractions;
using CRIF.ACTion.Loan.Individuals;
using Landmark.OLA.Models.Individuals;
using Landmark.OLA.Models.Individuals.Enums;
namespace CRIF.ACTion.Tests.Loan.Individuals
{
public class IncomeSectionBuilderTest : BuilderTestBase
{
private readonly ITestOutputHelper output;
public IncomeSectionBuilderTest(ITestOutputHelper output)
{
this.output = output;
}
[Fact]
public void Build_Income_Fail()
{
Assert.Throws<ArgumentNullException>(() => new IncomeSectionBuilder(new Income()).Build());
}
[Fact]
public void BuildIncomeSuccess()
{
var income = new Income()
{
AmountPerPeriod = 100,
Frequency = Frequency.Annually,
HoursPerWeek = 10,
IncomeStatus = IncomeStatus.IncomeStatus_Excluded,
IncomeTypeCD = IncomeType.Commissions,
SourceName = "Job"
};
var incomeElement = new IncomeSectionBuilder(income).Build();
output.WriteLine(Serialize(incomeElement));
string comparePath = @"Loan\Individuals\ExampleXML\BuildIncomeSuccess.xml";
var results = TestCommon.Compare(incomeElement, comparePath);
Assert.Empty(results);
}
}
}
@@ -0,0 +1,451 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using Xunit;
using CRIF.ACTion.Common;
using CRIF.ACTion.Loan.Individuals;
using Landmark.OLA.Models;
using Landmark.OLA.Models.Addresses;
using Landmark.OLA.Models.Addresses.Enums;
using Landmark.OLA.Models.HomeMortgageDisclosureAct;
using Landmark.OLA.Models.Individuals;
using Landmark.OLA.Models.Individuals.Enums;
using Landmark.OLA.Models.Loan.Enums;
using Landmark.OLA.Models.Residences;
namespace CRIF.ACTion.Tests.Loan.Individuals
{
public class PartiesSectionTest
{
private static Guid TestGuid => new("e4a1a31a-3985-4f76-955c-9227c9c94ba8");
private static readonly IApplicant TestIndividual = new Individual(new Guid("67755afb-b125-4a48-959e-7cedead90f8f"))
{
FirstName = "Jane",
MiddleInitial = "A",
LastName = "Doe",
Suffix = Suffix.III,
DOB = new DateTime(2018, 7, 9),
Phone = "1235555555",
PhoneType = PhoneType.Home,
SSN = "000090001",
Email = "[email protected]",
IsMarried = false,
Language = LanguageOption.English,
Address = new CurrentResidenceAddress(new Guid("b09444c1-c12f-4c3e-b787-04c44b6be0c4"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
MonthsResided = 12,
ResidenceType = ResidenceTypeOption.Own,
MonthlyPayment = 100,
},
OtherIncomes =
[
new Income
{
IncomeTypeCD = IncomeType.SocialSecurity,
Frequency = Frequency.Monthly,
SourceName = "Freeform Text",
AmountPerPeriod = 123.45m,
IncomeStatus = IncomeStatus.IncomeStatus_Included,
},
new Income
{
IncomeTypeCD = IncomeType.Alimony,
Frequency = Frequency.Annually,
SourceName = "Child Support",
AmountPerPeriod = 600,
IncomeStatus = IncomeStatus.IncomeStatus_Included,
}
],
Employers =
[
new Employer(employerId: new Guid("2fd067f2-bd3d-4053-990e-f4282180db63"))
{
Name = "College Pro Painters",
Title = "tester",
WorkPhone = "9992245555",
StartDate = new DateTime(2017, 01, 01),
MonthsEmployed = 60,
CurrentEmployer = true,
EmploymentType = EmploymentTypeOption.FullTime,
Language = LanguageOption.English,
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Salary",
AmountPerPeriod = 5000.0m,
Frequency = Frequency.Annually,
IncomeStatus = IncomeStatus.IncomeStatus_Included
}
}
]
};
public static IEnumerable<Object[]> GetSuffixElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var suffixElements = PartiesSection.GetSuffixElement(TestIndividual);
yield return new Object[] {
suffixElements,
"GetSuffixElement.xml"
};
}
public static IEnumerable<Object[]> GetTradesElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var mockPropertyLot = new PropertyLot
{
RentalAmt = 150
};
var tradesElement = PartiesSection.GetTradesElement(TestIndividual, mockPropertyLot);
yield return new Object[] {
tradesElement,
"GetTradesElement.xml"
};
}
public static IEnumerable<Object[]> AddChannelParty()
{
var section = new PartiesSection("", TestCommon.GetTestSettings());
section.AddSourceChannelParty(TestGuid, LoanType.EQ_HELOC_Flex);
yield return new Object[] {
section.Build(),
"AddChannelParty.xml"
};
}
public static IEnumerable<Object[]> AddEmployer()
{
var section = new PartiesSection("", TestCommon.GetTestSettings());
section.AddEmployer(TestIndividual.Employers.First());
yield return new Object[] {
section.Build(),
"AddEmployer.xml"
};
}
public static IEnumerable<Object[]> GetContactMechanismElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var contactElement = PartiesSection.GetContactMechanismElement(TestIndividual.Phone, ContactMechanisms.CrifContactMechanism.HomePhone);
yield return new Object[] {
contactElement,
"GetContactMechanismElement.xml"
};
}
public static IEnumerable<Object[]> GetContactMechanismsSectionElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var element = PartiesSection.GetContactMechanismsSectionElement(TestIndividual);
yield return new Object[] {
element,
"GetContactMechanismsSectionElement.xml"
};
}
public static IEnumerable<Object[]> GetEmployerContactMechanismsSectionElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var element = PartiesSection.GetEmployerContactMechanismsSectionElement(TestIndividual.Employers.First());
yield return new Object[] {
element,
"GetEmployerContactMechanismsSectionElement.xml"
};
}
public static IEnumerable<Object[]> GetIncomesSectionElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var element = PartiesSection.GetIncomesSectionElement(TestIndividual);
yield return new Object[] {
element,
"GetIncomesSectionElement.xml"
};
}
public static IEnumerable<Object[]> GetMaritalStatusElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var isMarried = PartiesSection.GetMaritalStatusElement(true);
yield return new Object[] {
isMarried,
"GetMaritalStatusElement-True.xml"
};
var isNotMarried = PartiesSection.GetMaritalStatusElement(false);
yield return new Object[] {
isNotMarried,
"GetMaritalStatusElement-False.xml"
};
}
public static IEnumerable<Object[]> GetPartyRelationshipsSectionElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var element = PartiesSection.GetApplicantPartyRelationshipsSectionElement(TestIndividual);
yield return new Object[] {
element,
"GetPartyRelationshipsSectionElement.xml"
};
}
public static IEnumerable<Object[]> AddIndividual()
{
var section = new PartiesSection("", TestCommon.GetTestSettings());
section.AddApplicant(TestIndividual);
yield return new Object[] {
section.Build(),
"AddIndividual.xml"
};
}
public static IEnumerable<Object[]> AddOrganizationParty()
{
var section = new PartiesSection("", TestCommon.GetTestSettings());
section.AddOrganizationParty(TestGuid);
yield return new Object[] {
section.Build(),
"AddOrganizationParty.xml"
};
}
public static IEnumerable<Object[]> GetAddressContactMechanismElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var currentAddress = PartiesSection.GetAddressContactMechanismElement(TestGuid, ContactMechanisms.CrifContactMechanism.CurrentAddress);
yield return new Object[] {
currentAddress,
"GetAddressContactMechanismElement-Current.xml"
};
var previousAddress = PartiesSection.GetAddressContactMechanismElement(TestGuid, ContactMechanisms.CrifContactMechanism.PreviousAddress);
yield return new Object[] {
previousAddress,
"GetAddressContactMechanismElement.xml"
};
}
public static IEnumerable<Object[]> GetEthnicitiesElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var individualEthnicityAndDidNotFurnish = new Individual
{
HmdaValues = new Hmda
{
Ethnicities = [Ethnicity.Cuban],
}
};
yield return new Object[] {
PartiesSection.GetEthnicitiesElement(individualEthnicityAndDidNotFurnish),
"GetEthnicitiesElement.xml"
};
var individual = new Individual
{
HmdaValues = new Hmda
{
Ethnicities =
[
Ethnicity.Cuban,
Ethnicity.NotProvided,
]
}
};
yield return new Object[] {
PartiesSection.GetEthnicitiesElement(individual),
"GetEthnicitiesElement.xml"
};
var individualDidNotFurnish = new Individual
{
HmdaValues = new Hmda
{
Ethnicities =
[
Ethnicity.NotProvided,
]
}
};
yield return new Object[] {
PartiesSection.GetEthnicitiesElement(individualDidNotFurnish),
"GetEthnicitiesElement-DidNotProvide.xml"
};
}
public static IEnumerable<Object[]> GetRacesElement()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var individual = new Individual
{
HmdaValues = new Hmda
{
Races =
[
Race.AmericanIndianAlaskaNative,
Race.OtherPacificIslander,
],
AmericanIndianAlaskaNativeTribe = "Forest County Potawatomi",
OtherAsianRace = "Hmong",
}
};
yield return new Object[] {
PartiesSection.GetRacesElement(individual),
"GetRacesElement.xml"
};
var individualWithNotProvided = new Individual
{
HmdaValues = new Hmda
{
Races =
[
Race.AmericanIndianAlaskaNative,
Race.OtherPacificIslander,
Race.NotProvided
],
AmericanIndianAlaskaNativeTribe = "Forest County Potawatomi",
OtherAsianRace = "Hmong",
}
};
yield return new Object[] {
PartiesSection.GetRacesElement(individualWithNotProvided),
"GetRacesElement.xml"
};
var individualOnlyNotProvided = new Individual
{
HmdaValues = new Hmda
{
Races =
[
Race.NotProvided
]
}
};
yield return new Object[] {
PartiesSection.GetRacesElement(individualOnlyNotProvided),
"GetRacesElement-NotProvided.xml"
};
}
public static IEnumerable<Object[]> GetSexAttributes()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var individual = new Individual
{
HmdaValues = new Hmda
{
Sexes =
[
Sex.Female,
Sex.NotProvided,
]
}
};
var individualElement = new XElement(CrifNamespaces.Common + "individual", PartiesSection.GetSexAttributes(individual));
yield return new Object[] {
individualElement,
"GetSexAttributes.xml"
};
var individualNotProvided = new Individual
{
HmdaValues = new Hmda
{
Sexes =
[
Sex.NotProvided,
]
}
};
individualElement = new XElement(CrifNamespaces.Common + "individual", PartiesSection.GetSexAttributes(individualNotProvided));
yield return new Object[] {
individualElement,
"GetSexAttributes-NotProvided.xml"
};
}
public static IEnumerable<Object[]> GetNoCoApplicantDetermination()
{
_ = new PartiesSection("", TestCommon.GetTestSettings());
var individualElement = new XElement(CrifNamespaces.Common + "determinations");
PartiesSection.AddNonApplicantHmdaDetermination(individualElement);
yield return new object[]
{
individualElement,
"GetNoCoApplicantDetermination.xml"
};
}
[Theory]
[MemberData(nameof(AddChannelParty))]
[MemberData(nameof(AddEmployer))]
[MemberData(nameof(AddIndividual))]
[MemberData(nameof(AddOrganizationParty))]
[MemberData(nameof(GetContactMechanismElement))]
[MemberData(nameof(GetContactMechanismsSectionElement))]
[MemberData(nameof(GetEmployerContactMechanismsSectionElement))]
[MemberData(nameof(GetIncomesSectionElement))]
[MemberData(nameof(GetMaritalStatusElement))]
[MemberData(nameof(GetAddressContactMechanismElement))]
[MemberData(nameof(GetPartyRelationshipsSectionElement))]
[MemberData(nameof(GetEthnicitiesElement))]
[MemberData(nameof(GetRacesElement))]
[MemberData(nameof(GetSexAttributes))]
[MemberData(nameof(GetTradesElement))]
[MemberData(nameof(GetSuffixElement))]
[MemberData(nameof(GetNoCoApplicantDetermination))]
public void CheckXmlCreation(XElement xElement, string fileName)
{
Assert.True(ModelValidator.TryValidate(xElement));
var result = TestCommon.Compare(xElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "PartiesSection"
+ System.IO.Path.DirectorySeparatorChar + fileName);
Assert.Empty(result);
}
}
}
@@ -0,0 +1,62 @@
using System.Collections.Generic;
using System.IO;
using Xunit;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using CRIF.ACTion.Loan.Assets;
using Landmark.OLA.Models.Assets;
using Landmark.OLA.Models.Assets.Enums;
namespace CRIF.ACTion.Tests.Loan
{
public class LienPositionTest
{
private readonly RealEstateBase _realEstateBase = new()
{
CurrentlyBeingRemodeledOrImproved = false,
CurrentlyListedForSale = true,
Use = PropertyUse.SecondHome,
LienPosition = new LienPosition
{
HasFirstMortgage = true,
HasSecondMortgage = true,
PayoffFirstMortgage = false,
PayoffSecondMortgage = false
}
};
[Fact]
public void GetFirstLienPositionTest()
{
_ = new RealEstateProperty(_realEstateBase);
using StreamReader file = File.OpenText("Loan" + Path.DirectorySeparatorChar +
"json" + Path.DirectorySeparatorChar + "TestLienPositions.json");
using JsonTextReader reader = new(file);
JObject allData = (JObject)JToken.ReadFrom(reader);
JArray firstLien = (JArray)allData["first"];
IList<LienPosition> validFirstLienPositions = firstLien.ToObject<IList<LienPosition>>();
JArray secondLien = (JArray)allData["second"];
IList<LienPosition> validSecondLienPositions = secondLien.ToObject<IList<LienPosition>>();
JArray thirdLien = (JArray)allData["third"];
IList<LienPosition> validThirdLienPositions = thirdLien.ToObject<IList<LienPosition>>();
foreach (var position in validFirstLienPositions)
{
LienPositionType calculatedPosition = RealEstateProperty.GetLienPosition(position);
Assert.Equal(LienPositionType.First, calculatedPosition);
}
foreach (var position in validSecondLienPositions)
{
LienPositionType calculatedPosition = RealEstateProperty.GetLienPosition(position);
Assert.Equal(LienPositionType.Second, calculatedPosition);
}
foreach (var position in validThirdLienPositions)
{
LienPositionType calculatedPosition = RealEstateProperty.GetLienPosition(position);
Assert.Equal(LienPositionType.Third, calculatedPosition);
}
}
}
}
@@ -0,0 +1,384 @@
using System;
using System.Collections.Generic;
using Xunit;
using CRIF.ACTion.Loan;
using CRIF.ACTion.Common.Parsers;
using Landmark.OLA.Models.Addresses;
using Landmark.OLA.Models.Addresses.Enums;
using Landmark.OLA.Models.Individuals;
using Landmark.OLA.Models.Individuals.Enums;
using Landmark.OLA.Models.Loan;
using Landmark.OLA.Models.Loan.Enums;
using Landmark.OLA.Models.Residences;
namespace CRIF.ACTion.Tests.Loan
{
public class LoanApplicationRequestBuilderTest
{
private readonly IResponseParser<LoanApplication> _loanApplicationResponseParser;
private readonly LoanApplication _loanApplication =
new(DateTime.Parse("2018-01-01T06:00:00.0000000Z", null, System.Globalization.DateTimeStyles.AssumeLocal), new Guid("9ed5a50f-279c-49b0-b5b4-d5b614e42501"))
{
LoanType = LoanType.CC_Secure,
RequestedAmount = 154.20m,
PrimaryContactMethod = "1234567890",
DisclosureDate = DateTime.Parse("2019-03-08T19:50:26.429Z"),
IPAddress = "111.11.1111",
PromoCode = "asdfas-12341",
Purpose = LoanPurpose.Purpose.Other,
PrimaryBorrower = new Individual(new Guid("8066fa2a-16ba-4148-b28c-2926ba263c5f"))
{
FirstName = "Jane",
MiddleInitial = "A",
LastName = "Doe",
DOB = new DateTime(2018, 7, 9),
Phone = "1235555555",
PhoneType = PhoneType.Home,
SSN = "000090001",
Email = "[email protected]",
IsMarried = false,
Language = LanguageOption.English,
Address = new CurrentResidenceAddress(new Guid("bf7e502a-9830-43c6-b603-1a32294c7e1a"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
MonthsResided = 12,
ResidenceType = ResidenceTypeOption.Own,
MonthlyPayment = 100,
},
MailingAddress = new Address(new Guid("f84db562-36a0-4039-9ce5-346a2ba6899b"))
{
Address1 = "321 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151"
},
Employers =
[
new Employer(employerId: new Guid("eee4efa3-327f-4ce5-9e8b-8c3e7a865fff"))
{
Name = "College Pro Painters",
Title = "tester",
WorkPhone = "9992245555",
MonthsEmployed = 60,
StartDate = new DateTime(2017, 01, 01),
CurrentEmployer = true,
EmploymentType = EmploymentTypeOption.FullTime,
Language = LanguageOption.English,
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Salary",
AmountPerPeriod = 5000.0m,
Frequency = Frequency.Annually,
IncomeStatus = IncomeStatus.IncomeStatus_Included
}
}
]
},
CoApplicant = new CoApplicant(new Guid("ba99037f-df92-46d4-a477-ffecea1f4837"))
{
FirstName = "John",
LastName = "Smith",
DOB = new DateTime(2018, 7, 25),
SSN = "111221111",
Phone = "5555550983",
PhoneType = PhoneType.Mobile,
Email = "[email protected]",
IsMarried = true,
Language = LanguageOption.English,
HasOptedOutTCPA = true,
Address = new CurrentResidenceAddress(new Guid("ae795a5f-1ea3-4186-b4b8-e9f9b81e3059"))
{
Address1 = "339 1st St",
Address2 = "#76",
City = "Milwaukee",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53202",
ResidenceType = ResidenceTypeOption.Rent,
MonthsResided = 12,
MonthlyPayment = 100,
},
PreviousAddresses =
[
new ResidenceAddress(new Guid("e7e881f0-d371-4371-8022-cce4f700e6d6"))
{
Address1 = "339 1st St",
Address2 = "#80",
City = "Milwaukee",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53202",
ResidenceType = ResidenceTypeOption.Rent,
MonthsResided = 6,
},
],
Employers =
[
new Employer(employerId: new Guid("e8436884-0e6c-4144-8de5-1f44c7936a23"))
{
StartDate = new DateTime(2015, 01, 01),
Name = "Chocolate Teapot Manfuacturing Inc",
EmploymentType = EmploymentTypeOption.PartTime,
Title = "Lead Teapot Assembler",
WorkPhone = "5556783241",
CurrentEmployer = true,
Language = LanguageOption.English,
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Work",
AmountPerPeriod = 100m,
Frequency = Frequency.Monthly,
IncomeStatus = IncomeStatus.IncomeStatus_Included
},
},
new Employer(employerId: new Guid("58d25f44-1260-428d-ac2c-d8804b06ed66"))
{
StartDate = new DateTime(2015, 01, 01),
Name = "Vanilla Teapot Manfuacturing Coop",
EmploymentType = EmploymentTypeOption.PartTime,
Title = "Junior Teapot Assembler",
WorkPhone = "5559572318",
CurrentEmployer = true,
Language = LanguageOption.English,
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Work",
AmountPerPeriod = 50m,
Frequency = Frequency.Monthly,
IncomeStatus = IncomeStatus.IncomeStatus_Included
},
},
],
},
};
private readonly LoanApplication _loanApplicationWithSpouse =
new(DateTime.Parse("2018-01-01T06:00:00.0000000Z", null, System.Globalization.DateTimeStyles.AssumeLocal), new Guid("9ed5a50f-279c-49b0-b5b4-d5b614e42501"))
{
LoanType = LoanType.CC_Secure,
RequestedAmount = 154.20m,
Purpose = LoanPurpose.Purpose.Other,
DisclosureDate = DateTime.Parse("2019-03-08T19:50:26.429Z"),
IPAddress = "111.11.1111",
PrimaryBorrower = new Individual(new Guid("8066fa2a-16ba-4148-b28c-2926ba263c5f"))
{
FirstName = "Jane",
MiddleInitial = "A",
LastName = "Doe",
DOB = new DateTime(2018, 7, 9),
Phone = "1235555555",
PhoneType = PhoneType.Home,
SSN = "000090001",
Email = "[email protected]",
IsMarried = false,
Language = LanguageOption.English,
Address = new CurrentResidenceAddress(new Guid("bf7e502a-9830-43c6-b603-1a32294c7e1a"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
MonthsResided = 12,
ResidenceType = ResidenceTypeOption.Own,
MonthlyPayment = 100,
},
MailingAddress = new Address(new Guid("f84db562-36a0-4039-9ce5-346a2ba6899b"))
{
Address1 = "321 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151"
},
Employers =
[
new Employer(employerId: new Guid("eee4efa3-327f-4ce5-9e8b-8c3e7a865fff"))
{
Name = "College Pro Painters",
Title = "tester",
WorkPhone = "9992245555",
MonthsEmployed = 60,
StartDate = new DateTime(2017, 01, 01),
CurrentEmployer = true,
EmploymentType = EmploymentTypeOption.FullTime,
Language = LanguageOption.English,
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Salary",
AmountPerPeriod = 5000.0m,
Frequency = Frequency.Annually,
IncomeStatus = IncomeStatus.IncomeStatus_Included
}
}
],
DetailedNonApplicantSpouse = new HistoryIndividual(new Guid("ba99037f-df92-46d4-a477-ffecea1f4837"))
{
FirstName = "John",
LastName = "Smith",
DOB = new DateTime(2018, 7, 25),
SSN = "111221111",
Phone = "5555550983",
PhoneType = PhoneType.Mobile,
Email = "[email protected]",
Language = LanguageOption.English,
HasOptedOutTCPA = true,
Address = new CurrentResidenceAddress(new Guid("ae795a5f-1ea3-4186-b4b8-e9f9b81e3059"))
{
Address1 = "339 1st St",
Address2 = "#76",
City = "Milwaukee",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53202",
ResidenceType = ResidenceTypeOption.Rent,
MonthsResided = 12,
MonthlyPayment = 100,
},
PreviousAddresses =
[
new ResidenceAddress(new Guid("e7e881f0-d371-4371-8022-cce4f700e6d6"))
{
Address1 = "339 1st St",
Address2 = "#80",
City = "Milwaukee",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53202",
ResidenceType = ResidenceTypeOption.Rent,
MonthsResided = 6,
},
],
Employers =
[
new Employer(employerId: new Guid("e8436884-0e6c-4144-8de5-1f44c7936a23"))
{
StartDate = new DateTime(2015, 01, 01),
Name = "Chocolate Teapot Manfuacturing Inc",
EmploymentType = EmploymentTypeOption.PartTime,
Title = "Lead Teapot Assembler",
WorkPhone = "5556783241",
CurrentEmployer = true,
Language = LanguageOption.English,
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Work",
AmountPerPeriod = 100m,
Frequency = Frequency.Monthly,
IncomeStatus = IncomeStatus.IncomeStatus_Included
},
},
new Employer(employerId: new Guid("58d25f44-1260-428d-ac2c-d8804b06ed66"))
{
StartDate = new DateTime(2015, 01, 01),
Name = "Vanilla Teapot Manfuacturing Coop",
EmploymentType = EmploymentTypeOption.PartTime,
Title = "Junior Teapot Assembler",
WorkPhone = "5559572318",
CurrentEmployer = true,
Language = LanguageOption.English,
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Work",
AmountPerPeriod = 50m,
Frequency = Frequency.Monthly,
IncomeStatus = IncomeStatus.IncomeStatus_Included
},
},
],
}
}
};
private readonly List<Guid> Guids = new List<Guid>
{
new Guid("64f4efa3-327f-4ce5-9e8b-8c3e7a8656d5"), //org
new Guid("292d0c30-976b-47f9-85a4-487ce0b3e1e8"), //source channel
new Guid("3090a5a1-d493-4865-ba44-8fd390dfec44"), //distribution/servicing channel
};
public LoanApplicationRequestBuilderTest()
{
_loanApplicationResponseParser = new LoanApplicationResponseParser();
}
[Fact]
public void Validate()
{
var createAppElement = new LoanApplicationRequestBuilder(_loanApplication, TestCommon.GetTestSettings()).Build();
Assert.Empty(TestCommon.Validate(createAppElement));
}
[Fact]
public void CreateApplication()
{
var appCreator = new LoanApplicationRequestBuilder(_loanApplication, TestCommon.GetTestSettings(),
Guids[0], Guids[1], Guids[2], new TestDistributionChannelLookupService());
var createAppElement = appCreator.Build();
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "CreateApp" + System.IO.Path.DirectorySeparatorChar + "CreateApplication.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateApplicationWithNote()
{
_loanApplication.Note = "Example application note.";
var createAppElement = new LoanApplicationRequestBuilder(_loanApplication, TestCommon.GetTestSettings(),
Guids[0], Guids[1], Guids[2], new TestDistributionChannelLookupService()).Build();
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "CreateApp" + System.IO.Path.DirectorySeparatorChar + "CreateApplicationWithNote.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateApplicationNonSingingHistorySpouse()
{
var createAppElement = new LoanApplicationRequestBuilder(_loanApplicationWithSpouse, TestCommon.GetTestSettings(),
Guids[0], Guids[1], Guids[2], new TestDistributionChannelLookupService()).Build();
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "CreateApp" + System.IO.Path.DirectorySeparatorChar + "CreateApplicationNonSigningHistorySpouse.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void AddPurposeOfLoanSignature()
{
_loanApplication.LoanType = LoanType.S_Signature;
_loanApplication.PurposeOfLoanSignature = "Test Purpose of Loan Signature";
bool check = false;
if (_loanApplication.LoanType == LoanType.S_Signature && !string.IsNullOrWhiteSpace(_loanApplication.PurposeOfLoanSignature))
{
check = true;
}
Assert.True(check);
}
}
}
@@ -0,0 +1,243 @@
using System;
using Xunit;
using CRIF.ACTion.Loan;
using Landmark.OLA.Models.Addresses;
using Landmark.OLA.Models.Addresses.Enums;
using Landmark.OLA.Models.Assets;
using Landmark.OLA.Models.Assets.Enums;
using Landmark.OLA.Models.HomeMortgageDisclosureAct;
using Landmark.OLA.Models.Individuals;
using Landmark.OLA.Models.Individuals.Enums;
using Landmark.OLA.Models.Loan;
using Landmark.OLA.Models.Loan.Enums;
using Landmark.OLA.Models.Residences;
namespace CRIF.ACTion.Tests.Loan
{
public class MfgHomeAndLandTest
{
private readonly LoanApplication _loanApplication =
new(loanDate: DateTime.Parse("2018-01-01T06:00:00.0000000Z", null, System.Globalization.DateTimeStyles.AssumeLocal), loanId: "7c0d9659-4d37-4ae7-93ce-e6c72ad6a0b5")
{
LoanType = LoanType.EQ_Mfg_Home_With_or_Without_Land,
Purpose = LoanPurpose.Purpose.Purchase,
RequestedAmount = 1000,
PrimaryContactMethod = "1234567890",
DisclosureDate = DateTime.Parse("2019-03-08T19:50:26.429Z"),
IPAddress = "111.11.1111",
ManufacturedHome = new ManufacturedHome(new Guid("7c0d9659-4d37-4ae7-93ce-e6c72ad6a0b5"))
{
CurrentlyBeingRemodeledOrImproved = false,
CurrentlyListedForSale = false,
Type = ManufacturedHomeType.Double,
Use = PropertyUse.OwnerOccupied,
Lot = new PropertyLot(new Guid("f370b54c-5999-4ebc-b1b6-078cc8571652"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
IsRented = true,
RentalAmt = 123.45m,
},
},
PrimaryBorrower = new Individual(new Guid("b0fb7c37-a203-4c06-89cb-e4e9f3ca20d4"))
{
Language = LanguageOption.English,
FirstName = "Jane",
MiddleInitial = "J",
LastName = "Doe",
DOB = new DateTime(2018, 01, 01),
SSN = "666666666",
Phone = "5555550100",
PhoneType = PhoneType.Home,
Email = "[email protected]",
IsMarried = false,
IsLandmarkEmployee = true,
Address = new CurrentResidenceAddress(new Guid("66eecd56-4877-47d9-b2b1-45d11a087322"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
MonthlyPayment = 1000m,
MonthsResided = 120,
ResidenceType = ResidenceTypeOption.Own,
},
HmdaValues = new Hmda
{
HmdaNoticeDisclosed = true,
Races =
[
Race.NotProvided,
],
Ethnicities =
[
Ethnicity.OtherHispanicLatino,
],
OtherHispanicLatinoEthnicity = "Argentinean",
Sexes =
[
Sex.Female,
Sex.Male,
],
},
Employers =
[
new Employer(employerId: new Guid("57df49cc-ff09-4660-aa47-54fdb5e08017"))
{
Language = LanguageOption.English,
Name = "Purple Widgets Inc",
CurrentEmployer = true,
EmploymentType = EmploymentTypeOption.FullTime,
MonthsEmployed = 120,
StartDate = new DateTime(2008, 01, 01),
EndDate = new DateTime(2018,01,01),
Title = "Lead Widget Painter",
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Job",
AmountPerPeriod = 100m,
Frequency = Frequency.Hourly,
IncomeStatus = IncomeStatus.IncomeStatus_Included,
},
},
],
}
};
private readonly LoanApplication _loanApplicationWithAnnualTaxes =
new(loanDate: DateTime.Parse("2018-01-01T06:00:00.0000000Z", null, System.Globalization.DateTimeStyles.AssumeLocal), loanId: "7c0d9659-4d37-4ae7-93ce-e6c72ad6a0b5")
{
LoanType = LoanType.EQ_Mfg_Home_With_or_Without_Land,
Purpose = LoanPurpose.Purpose.Purchase,
RequestedAmount = 1000,
PrimaryContactMethod = "1234567890",
DisclosureDate = DateTime.Parse("2019-03-08T19:50:26.429Z"),
IPAddress = "111.11.1111",
ManufacturedHome = new ManufacturedHome(new Guid("7c0d9659-4d37-4ae7-93ce-e6c72ad6a0b5"))
{
CurrentlyBeingRemodeledOrImproved = false,
CurrentlyListedForSale = false,
Type = ManufacturedHomeType.Double,
Use = PropertyUse.OwnerOccupied,
Lot = new PropertyLot(new Guid("f370b54c-5999-4ebc-b1b6-078cc8571652"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
IsRented = false,
AnnualPropertyTax = 4500,
},
},
PrimaryBorrower = new Individual(new Guid("b0fb7c37-a203-4c06-89cb-e4e9f3ca20d4"))
{
Language = LanguageOption.English,
FirstName = "Jane",
MiddleInitial = "J",
LastName = "Doe",
DOB = new DateTime(2018, 01, 01),
SSN = "666666666",
Phone = "5555550100",
PhoneType = PhoneType.Home,
Email = "[email protected]",
IsMarried = false,
IsLandmarkEmployee = true,
Address = new CurrentResidenceAddress(new Guid("66eecd56-4877-47d9-b2b1-45d11a087322"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
MonthlyPayment = 1000m,
MonthsResided = 120,
ResidenceType = ResidenceTypeOption.Own,
},
HmdaValues = new Hmda
{
HmdaNoticeDisclosed = true,
Races =
[
Race.NotProvided,
],
Ethnicities =
[
Ethnicity.OtherHispanicLatino,
],
OtherHispanicLatinoEthnicity = "Argentinean",
Sexes =
[
Sex.Female,
Sex.Male,
],
},
Employers =
[
new Employer(employerId: new Guid("57df49cc-ff09-4660-aa47-54fdb5e08017"))
{
Language = LanguageOption.English,
Name = "Purple Widgets Inc",
CurrentEmployer = true,
EmploymentType = EmploymentTypeOption.FullTime,
MonthsEmployed = 120,
StartDate = new DateTime(2008, 01, 01),
EndDate = new DateTime(2018,01,01),
Title = "Lead Widget Painter",
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Job",
AmountPerPeriod = 100m,
Frequency = Frequency.Hourly,
IncomeStatus = IncomeStatus.IncomeStatus_Included,
},
},
],
}
};
[Fact]
public void Validate()
{
var createAppElement =
new LoanApplicationRequestBuilder(_loanApplication, TestCommon.GetTestSettings()).Build();
Assert.Empty(TestCommon.Validate(createAppElement));
}
[Fact]
public void CreateApplication()
{
var createAppElement = new LoanApplicationRequestBuilder(_loanApplication, TestCommon.GetTestSettings(),
new Guid("741be6b4-9f42-4efd-871f-f5d99c0ef122"), new Guid("e814d860-14fe-4bef-be9b-21be3dce1edf"),
new Guid("3090a5a1-d493-4865-ba44-8fd390dfec44"), new TestDistributionChannelLookupService()).Build();
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "MfgHomeAndLand" + System.IO.Path.DirectorySeparatorChar + "CreateApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateApplicationWithAnnualTaxes()
{
var createAppElement = new LoanApplicationRequestBuilder(_loanApplicationWithAnnualTaxes, TestCommon.GetTestSettings(),
new Guid("741be6b4-9f42-4efd-871f-f5d99c0ef122"), new Guid("e814d860-14fe-4bef-be9b-21be3dce1edf"),
new Guid("3090a5a1-d493-4865-ba44-8fd390dfec44"), new TestDistributionChannelLookupService()).Build();
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "MfgHomeAndLand" + System.IO.Path.DirectorySeparatorChar + "CreateAppWithAnnualTaxes.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
}
}
@@ -0,0 +1,28 @@
using System;
using Xunit;
using CRIF.ACTion.Loan;
namespace CRIF.ACTion.Tests.Loan
{
public class OrgSectionTest
{
private static Guid TestGuid => new("a333a064-be7b-4d20-841f-9c3c306866b3");
[Fact]
public void SetOrgId()
{
var section = new OrgSection("", TestCommon.GetTestSettings());
section.SetOrgId(TestGuid);
var orgElement = section.Build();
var result = TestCommon.Compare(orgElement,
"ExampleXML" + System.IO.Path.DirectorySeparatorChar + "OrgSection"
+ System.IO.Path.DirectorySeparatorChar + "SetOrgId.xml");
Assert.Empty(result);
}
}
}
@@ -0,0 +1,99 @@
using System;
using System.Xml.Linq;
using Xunit;
using CRIF.ACTion.Common;
using CRIF.ACTion.Loan;
using Landmark.OLA.Models.Addresses.Enums;
using Landmark.OLA.Models.Individuals;
using Landmark.OLA.Models.Individuals.Enums;
using Landmark.OLA.Models.Loan;
using Landmark.OLA.Models.Loan.Enums;
using Landmark.OLA.Models.Residences;
namespace CRIF.ACTion.Tests.Loan
{
public class SignatureLoanTest
{
private readonly LoanApplication _loanApplication =
new(loanDate: DateTime.Parse("2018-01-01T06:00:00.0000000Z", null, System.Globalization.DateTimeStyles.AssumeLocal), loanId: "7c0d9659-4d37-4ae7-93ce-e6c72ad6a0b5")
{
LoanType = LoanType.S_Signature,
Purpose = LoanPurpose.Purpose.Other,
PurposeOfLoanSignature = "Test Purpose",
RequestedAmount = 13000,
PrimaryContactMethod = "1234567890",
DisclosureDate = DateTime.Parse("2019-03-08T19:50:26.429Z"),
IPAddress = "111.11.1111",
TermLengthInMonths = 36,
PrimaryBorrower = new Individual(new Guid("b0fb7c37-a203-4c06-89cb-e4e9f3ca20d4"))
{
Language = LanguageOption.English,
FirstName = "Jane",
MiddleInitial = "J",
LastName = "Doe",
DOB = new DateTime(2018, 01, 01),
SSN = "666666666",
Phone = "5555550100",
PhoneType = PhoneType.Home,
Email = "[email protected]",
IsMarried = false,
Address = new CurrentResidenceAddress(new Guid("66eecd56-4877-47d9-b2b1-45d11a087322"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
MonthlyPayment = 1000m,
MonthsResided = 120,
ResidenceType = ResidenceTypeOption.Own,
}
}
};
private static XElement BuildApplication(LoanApplication loanApplication)
{
var createAppElement = new LoanApplicationRequestBuilder(loanApplication, TestCommon.GetTestSettings(),
new Guid("741be6b4-9f42-4efd-871f-f5d99c0ef122"), new Guid("e814d860-14fe-4bef-be9b-21be3dce1edf"),
new Guid("3090a5a1-d493-4865-ba44-8fd390dfec44"), new TestDistributionChannelLookupService()).Build();
return createAppElement;
}
[Fact]
public void Validate()
{
var createAppElement = new LoanApplicationRequestBuilder(_loanApplication, TestCommon.GetTestSettings()).Build();
Assert.Empty(TestCommon.Validate(createAppElement));
}
[Fact]
public void CreateApplication()
{
var createAppElement = BuildApplication(_loanApplication);
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "Signature" + System.IO.Path.DirectorySeparatorChar + "CreateApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void AddPurposeOfLoanSignature()
{
var appDetailElement = new XElement(CrifNamespaces.App + "Test",
new XAttribute(CrifNamespaces.App + "financedAmt", _loanApplication.RequestedAmount)
);
if (_loanApplication.LoanType == LoanType.S_Signature)
{
appDetailElement.Add(new XAttribute("purposeOfLoanSignature", "Testing Purpose of Loan Signature"));
}
Assert.True(appDetailElement.Attribute("purposeOfLoanSignature").Value == "Testing Purpose of Loan Signature");
}
}
}
@@ -0,0 +1,320 @@
using System;
using System.Xml.Linq;
using Xunit;
using CRIF.ACTion.Loan;
using Landmark.OLA.Models;
using Landmark.OLA.Models.Addresses.Enums;
using Landmark.OLA.Models.Assets;
using Landmark.OLA.Models.Assets.Enums;
using Landmark.OLA.Models.HomeMortgageDisclosureAct;
using Landmark.OLA.Models.Individuals;
using Landmark.OLA.Models.Individuals.Enums;
using Landmark.OLA.Models.Loan;
using Landmark.OLA.Models.Loan.Enums;
using Landmark.OLA.Models.Residences;
using Landmark.OLA.Models.Addresses;
namespace CRIF.ACTion.Tests.Loan
{
public class VehicleEtcTest
{
private readonly LoanApplication _loanApplication =
new(loanDate: DateTime.Parse("2018-01-01T06:00:00.0000000Z", null, System.Globalization.DateTimeStyles.AssumeLocal), loanId: "7c0d9659-4d37-4ae7-93ce-e6c72ad6a0b5")
{
LoanType = LoanType.V_Vehicle,
Purpose = LoanPurpose.Purpose.Purchase,
RequestedAmount = 7500,
PrimaryContactMethod = "1234567890",
TermLengthInMonths = 48,
DisclosureDate = DateTime.Parse("2019-03-08T19:50:26.429Z"),
IPAddress = "111.11.1111",
Vehicle = new Vehicle(valuationId: new Guid("254d06dd-9da2-4013-8021-c9aaf591807f"),
vehicleId: new Guid("7c0d9659-4d37-4ae7-93ce-e6c72ad6a0b5"))
{
ValuationType = VehicleValuationType.Invoice,
Year = 2019,
InitialEstimatedValue = 10000,
Make = "Datsun",
Model = "Go-Cross",
Mileage = 38,
Condition = NewUsed.New,
Type = VehicleType.Automobile
},
PrimaryBorrower = new Individual(new Guid("b0fb7c37-a203-4c06-89cb-e4e9f3ca20d4"))
{
Language = LanguageOption.English,
FirstName = "Jane",
MiddleInitial = "J",
LastName = "Doe",
DOB = new DateTime(2018, 01, 01),
SSN = "666666666",
Phone = "5555550100",
PhoneType = PhoneType.Home,
Email = "[email protected]",
IsMarried = false,
Address = new CurrentResidenceAddress(new Guid("66eecd56-4877-47d9-b2b1-45d11a087322"))
{
Address1 = "123 Main St",
City = "New Berlin",
State = StateOption.WI,
Country = CountryOption.UnitedStates,
PostalCode = "53151",
MonthlyPayment = 1000m,
MonthsResided = 120,
ResidenceType = ResidenceTypeOption.Own,
},
HmdaValues = new Hmda
{
HmdaNoticeDisclosed = true,
Races =
[
Race.NotProvided,
],
Ethnicities =
[
Ethnicity.OtherHispanicLatino,
],
OtherHispanicLatinoEthnicity = "Argentinean",
Sexes =
[
Sex.Female,
Sex.Male,
],
},
Employers =
[
new Employer(employerId: new Guid("57df49cc-ff09-4660-aa47-54fdb5e08017"))
{
Language = LanguageOption.English,
Name = "Purple Widgets Inc",
CurrentEmployer = true,
EmploymentType = EmploymentTypeOption.FullTime,
MonthsEmployed = 120,
StartDate = new DateTime(2008, 01, 01),
EndDate = new DateTime(2018,01,01),
Title = "Lead Widget Painter",
Income = new Income
{
IncomeTypeCD = IncomeType.Salary,
SourceName = "Job",
AmountPerPeriod = 100m,
Frequency = Frequency.Hourly,
HoursPerWeek = 40,
IncomeStatus = IncomeStatus.IncomeStatus_Included,
},
},
],
}
};
private static XElement BuildApplication(LoanApplication loanApplication)
{
var createAppElement = new LoanApplicationRequestBuilder(loanApplication, TestCommon.GetTestSettings(),
new Guid("741be6b4-9f42-4efd-871f-f5d99c0ef122"), new Guid("e814d860-14fe-4bef-be9b-21be3dce1edf"),
new Guid("3090a5a1-d493-4865-ba44-8fd390dfec44"), new TestDistributionChannelLookupService()).Build();
return createAppElement;
}
[Fact]
public void Validate()
{
ModelValidator.Validate(_loanApplication.Vehicle);
var createAppElement =
new LoanApplicationRequestBuilder(_loanApplication, TestCommon.GetTestSettings()).Build();
Assert.Empty(TestCommon.Validate(createAppElement));
}
[Fact]
public void CreateApplication()
{
var createAppElement = BuildApplication(_loanApplication);
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "Vehicle" + System.IO.Path.DirectorySeparatorChar + "CreateApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateMotorcyleApplication()
{
var motorcycleApplication = _loanApplication;
motorcycleApplication.Vehicle.Type = VehicleType.Motorcycle;
motorcycleApplication.Vehicle.Make = "Honda";
motorcycleApplication.Vehicle.Model = "Gold Wing";
var createAppElement = BuildApplication(_loanApplication);
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "Vehicle" + System.IO.Path.DirectorySeparatorChar + "CreateMotorcycleApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreatePreApprovalApplication()
{
var preApprovalApplication = _loanApplication;
preApprovalApplication.LoanType = LoanType.V_VehiclePreapproval;
preApprovalApplication.Vehicle = null;
var createAppElement = BuildApplication(_loanApplication);
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "Vehicle" + System.IO.Path.DirectorySeparatorChar + "CreatePreApprovalApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateBoatApplication()
{
var boatApplication = _loanApplication;
boatApplication.LoanType = LoanType.M_Boat;
boatApplication.Vehicle.Type = VehicleType.Boat;
boatApplication.Vehicle.BoatAddress = new Address(new Guid("60899299-c5b3-4683-bd3b-02a8ab1af35e"))
{
Address1 = "123 Boat Location Ave",
PostalCode = "12345",
City = "Schenectady",
State = StateOption.NY,
Country = CountryOption.UnitedStates
};
boatApplication.Vehicle.BoatLength = 16;
boatApplication.Vehicle.TrailerMake = "Trailer Make";
boatApplication.Vehicle.TrailerType = "TriAxle";
boatApplication.Vehicle.TrailerYear = 2010;
boatApplication.Vehicle.MotorMake = "Motor Make";
boatApplication.Vehicle.MotorModel = "Motor Model";
boatApplication.Vehicle.MotorType = 2;
boatApplication.Vehicle.MotorYear = 2005;
var createAppElement = BuildApplication(_loanApplication);
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "Vehicle" + System.IO.Path.DirectorySeparatorChar + "CreateBoatApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateAtvApplication()
{
var boatApplication = _loanApplication;
boatApplication.LoanType = LoanType.P_Powersport;
boatApplication.Vehicle.Type = VehicleType.ATV;
var createAppElement = BuildApplication(_loanApplication);
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "Vehicle" + System.IO.Path.DirectorySeparatorChar + "CreateAtvApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreatePwcApplication()
{
var boatApplication = _loanApplication;
boatApplication.LoanType = LoanType.P_Powersport;
boatApplication.Vehicle.Type = VehicleType.PWC;
var createAppElement = BuildApplication(_loanApplication);
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "Vehicle" + System.IO.Path.DirectorySeparatorChar + "CreatePwcApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateRvPowersportApplication()
{
var boatApplication = _loanApplication;
boatApplication.LoanType = LoanType.P_Powersport;
boatApplication.Vehicle.Type = VehicleType.RecreationalVehicle;
var createAppElement = BuildApplication(_loanApplication);
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "Vehicle" + System.IO.Path.DirectorySeparatorChar + "CreateRvPowersportApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateSnowmobileApplication()
{
var boatApplication = _loanApplication;
boatApplication.LoanType = LoanType.P_Powersport;
boatApplication.Vehicle.Type = VehicleType.Snowmobile;
var createAppElement = BuildApplication(_loanApplication);
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "Vehicle" + System.IO.Path.DirectorySeparatorChar + "CreateSnowmobileApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateMotorhomeApplication()
{
var motorhomeApplication = _loanApplication;
motorhomeApplication.LoanType = LoanType.T_TrailerMotorhome;
motorhomeApplication.Vehicle.Type = VehicleType.TrailerMotorHome;
var createAppElement = BuildApplication(_loanApplication);
string comparePath = "ExampleXML" + System.IO.Path.DirectorySeparatorChar + "Vehicle" + System.IO.Path.DirectorySeparatorChar + "CreateTrailerMotorhomeApp.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateApplicationWithNoteAndVehicleSeller()
{
_loanApplication.Note = "Example application note.";
_loanApplication.Vehicle.Seller = VehicleSeller.Private_Party;
var createAppElement = BuildApplication(_loanApplication);
string comparePath = @"ExampleXML/Vehicle/CreateApplicationWithNoteAndVehicleSeller.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
[Fact]
public void CreateApplicationWithVehicleSeller()
{
_loanApplication.Vehicle.Seller = VehicleSeller.Dealer;
var createAppElement = BuildApplication(_loanApplication);
string comparePath = @"ExampleXML/Vehicle/CreateApplicationWithVehicleSeller.xml";
var results = TestCommon.Compare(createAppElement, comparePath);
Assert.Empty(results);
}
}
}
@@ -0,0 +1,54 @@
{
"first":
[
{
"hasFirstMortgage": false,
"hasSecondMortgage": false,
"payoffFirstMortgage": false,
"payoffSecondMortgage": false
},
{
"hasFirstMortgage": true,
"hasSecondMortgage": false,
"payoffFirstMortgage": true,
"payoffSecondMortgage": false
},
{
"hasFirstMortgage": false,
"hasSecondMortgage": true,
"payoffFirstMortgage": false,
"payoffSecondMortgage": true
}
],
"second":
[
{
"hasFirstMortgage": true,
"hasSecondMortgage": false,
"payoffFirstMortgage": false,
"payoffSecondMortgage": false
},
{
"hasFirstMortgage": false,
"hasSecondMortgage": true,
"payoffFirstMortgage": false,
"payoffSecondMortgage": false
},
{
"hasFirstMortgage": true,
"hasSecondMortgage": true,
"payoffFirstMortgage": true,
"payoffSecondMortgage": false
}
],
"third":
[
{
"hasFirstMortgage": true,
"hasSecondMortgage": true,
"payoffFirstMortgage": false,
"payoffSecondMortgage": false
}
]
}