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 = "test@example.com", 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 = "test@example.com", 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); } } }