public void V2_31_00_PartyBuilder_CreateBuilder_CannotSetPartyTypeCode() { // Arrange/Act/Assert var ex = Assert.Throws <ArgumentException>(() => Party_Type.CreateBuilder(new Party_Type { PartyTypeCode = OLI_LU_PARTY.OLI_PT_PERSON })); Assert.Contains("The Party_Type.PartyTypeCode value should not be set.", ex.Message); }
public void V2_31_00_PartyBuilder_CreateBuilder_CannotSetItem() { // Arrange/Act/Assert var ex = Assert.Throws <ArgumentException>(() => Party_Type.CreateBuilder(new Party_Type { Item = new Person_Type() })); Assert.Contains("The Party_Type.Item value should not be set.", ex.Message); }
public void V2_31_00_PartyBuilder_NotSet_Test1() { // Arrange var builder = Party_Type.CreateBuilder(); // Act/Assert var ex = Assert.Throws <InvalidOperationException>(() => builder.Build()); Assert.Equal("You cannot build the Party_Type entity without first setting the PartyTypeCode.", ex.Message); }
protected override void ValidateBaseObject(Party_Type baseEntity) { if (baseEntity.ShouldSerializeItem()) { throw new ArgumentException("The Party_Type.Item value should not be set. This builder will help handle the ACORD spec logic with setting this property.", "baseEntity"); } if (baseEntity.ShouldSerializePartyTypeCode()) { throw new ArgumentException("The Party_Type.PartyTypeCode value should not be set. This builder will help handle the ACORD spec logic with setting this property.", "baseEntity"); } }
public void V2_37_00_PartyBuilder_Build_CannotSetItem() { // Arrange var builder = Party_Type.CreateBuilder() .WithUnknown(); // Act/Assert var ex = Assert.Throws <ArgumentException>(() => builder.Build(new Party_Type { Item = new Person_Type() })); Assert.Contains("The Party_Type.Item value should not be set.", ex.Message); }
public void V2_24_01_PartyBuilder_Build_CannotSetPartyTypeCode() { // Arrange var builder = Party_Type.CreateBuilder() .WithUnknown(); // Act/Assert var ex = Assert.Throws <ArgumentException>(() => builder.Build(new Party_Type { PartyTypeCode = OLI_LU_PARTY.OLI_PT_PERSON })); Assert.Contains("The Party_Type.PartyTypeCode value should not be set.", ex.Message); }
public void V2_31_00_PartyBuilder_Unknown() { // Arrange var entity = Party_Type.CreateBuilder(new Party_Type { id = "test" }) .WithUnknown() .Build(); // Act string xmlString; entity.Serialize(out xmlString); // Assert Assert.Contains("<PartyTypeCode tc=\"0\">Unknown</PartyTypeCode>", xmlString); }
public void V2_31_00_PartyBuilder_Organization() { // Arrange var entity = Party_Type.CreateBuilder() .WithOrganization(new Organization_Type { id = "Org1" }) .Build(); // Act string xmlString; entity.Serialize(out xmlString); // Assert Assert.Contains("<Organization id=\"Org1\" />", xmlString); }
internal static IEnumerable<string> AdvisorData(TXLife_Type response, Party_Type party) { List<string> errors = new List<string>(); if (string.IsNullOrWhiteSpace(party.PartyTypeCode.tc)) { errors.Add("advisor partyTypeCode tc"); } if (party.Item == null) { errors.Add("advisor item"); } else { if (party.Item.GetType() != typeof(Person_Type)) { errors.Add("advisor item type"); return errors; } var person = party.Item as Person_Type; if (string.IsNullOrWhiteSpace(person.FirstName)) errors.Add("advisor firstname"); if (string.IsNullOrWhiteSpace(person.LastName)) errors.Add("advisor lastname"); } errors.AddRange(Email(party.EMailAddress, "Advisor")); return errors; }
public void V2_31_00_PartyBuilder_Person() { // Arrange var entity = Party_Type.CreateBuilder() .WithPerson(new Person_Type { id = "Person1" }) .Build(); // Act string xmlString; entity.Serialize(out xmlString); // Assert Assert.Contains("<Person id=\"Person1\" />", xmlString); }
internal static IEnumerable<string> AdvisorIdentity(Party_Type party) { List<string> errors = new List<string>(); var person = party.Item as Person_Type; if (party.PriorName != null) { foreach (var prior in party.PriorName) { if (string.IsNullOrWhiteSpace(prior.FirstName)) { errors.Add("advisor identity firstName"); } if (string.IsNullOrWhiteSpace(prior.LastName)) { errors.Add("advisor identity lastName"); } if (LUObjNotValid(prior.NameType)) { errors.Add("advisor identity nameType"); } } } if (party.Producer != null) { if (LUObjNotValid(party.Producer.PrefLanguage)) { errors.Add("identity prefLanguage"); } } return errors; }
internal static IEnumerable<string> EOCoverage(TXLife_Type response, Party_Type contractor) { List<string> errors = new List<string>(); var coverages = response.Items.OfType<Holding_Type>().Where(p => p.HoldingTypeCode.tc == "40"); foreach (var coverage in coverages) { if (string.IsNullOrWhiteSpace(coverage.id)) { errors.Add("contractor coverage id"); } if (coverage.Policy == null) { errors.Add("contractor coverage policy"); } else { if (string.IsNullOrWhiteSpace(coverage.Policy.CarrierPartyID)) { errors.Add("contractor coverage CarrierPartyID"); } if (string.IsNullOrWhiteSpace(coverage.Policy.PolNumber)) { errors.Add("contractor coverage PolNumber"); } if (LUObjNotValid(coverage.Policy.ProductType)) { errors.Add("contractor coverage productType"); } if (coverage.Policy.PolicyValueSpecified && coverage.Policy.PolicyValue == 0) { errors.Add("contractor coverage PolicyValue"); } if (LUObjNotValid(coverage.Policy.PolicyStatus)) { errors.Add("contractor coverage PolicyStatus"); } var coverageHolder = response.Items.OfType<Party_Type>().FirstOrDefault(p => p.id == coverage.Policy.CarrierPartyID); if (coverageHolder == null) { errors.Add("contractor coverage coverageHolder"); } else { if (string.IsNullOrWhiteSpace(coverageHolder.id)) { errors.Add("contractor coverage coverageHolder id"); } if (LUObjNotValid(coverageHolder.PartyTypeCode)) { errors.Add("contractor coverage coverageHolder partyTypeCode"); } if (coverageHolder.Item == null || !(coverageHolder.Item is Organization_Type)) { errors.Add("contractor coverage coverageHolder Item"); } if (string.IsNullOrWhiteSpace(coverageHolder.FullName)) { errors.Add("contractor coverage coverageHolder fullName"); } } } if (coverage.Attachment == null) { errors.Add("contractor coverage attachment"); } else { foreach (var attachment in coverage.Attachment) { errors.AddRange(Attachment(attachment, "Contractor coverage")); } } var coverageInfo = contractor.Producer.EOCoverageInfo.Where(p => p.HoldingID == coverage.id).FirstOrDefault(); if (coverageInfo == null) { errors.Add("contractor coverage producer coverageInfo"); } } return errors; }
internal static IEnumerable<string> Education(Party_Type contractor) { List<string> errors = new List<string>(); if (contractor.Producer.DesignationInfo != null) { foreach (var designation in contractor.Producer.DesignationInfo) { if (LUObjNotValid(designation.DesignationType)) { errors.Add("contractor education designationType"); } if (string.IsNullOrWhiteSpace(designation.DesignationYear)) { errors.Add("contractor education DesignationYear"); } if (designation.DesignationType != null && designation.DesignationType.tc == "2147483647" && string.IsNullOrWhiteSpace(designation.DesignationDesc)) errors.Add("contractor education DesignationDesc"); } } if (contractor.Item != null && contractor.Item is Person_Type) { var person = contractor.Item as Person_Type; if (LUObjNotValid(person.HighestEducationLevel)) { errors.Add("contractor education HighestEducationLevel"); } if (person.Education != null) { foreach (var education in person.Education) { if (string.IsNullOrWhiteSpace(education.Major)) { errors.Add("contractor education Major"); } if (string.IsNullOrWhiteSpace(education.ProviderOrSchool)) { errors.Add("contractor education ProviderOrSchool"); } } } } return errors; }
internal static IEnumerable<string> Criminal(Party_Type contractor) { List<string> errors = new List<string>(); if (contractor.Risk != null) { if (contractor.Risk.CriminalConviction == null) { errors.Add("contractor criminal"); } foreach (var conviction in contractor.Risk.CriminalConviction) { if (string.IsNullOrWhiteSpace(conviction.CrimeDescription)) { errors.Add("contractor criminal CrimeDescription"); } } } return errors; }
public static PartyBuilder CreateBuilder(Party_Type baseEntity) { return(new PartyBuilder(baseEntity)); }
internal static IEnumerable<string> OrganizationIdentity(Party_Type party) { List<string> errors = new List<string>(); if (string.IsNullOrWhiteSpace(party.GovtID)) { errors.Add("organization GovtID"); } if (LUObjNotValid(party.GovtIDTC)) { errors.Add("organization GovtIDTC"); } foreach (var id in party.GovtIDInfo) { if (LUObjNotValid(id)) { errors.Add("organization GovtIDInfo"); } } foreach (var attachment in party.Attachment) { errors.AddRange(Attachment(attachment, "organizationIdentity")); } return errors; }
internal static IEnumerable<string> Supervision(Party_Type contractor) { List<string> errors = new List<string>(); foreach (var supervision in contractor.Producer.SupervisionLevel) { if (LUObjNotValid(supervision.SupervisionLevelTC)) { errors.Add("contractor supervision SupervisionLevelTC"); } if (string.IsNullOrWhiteSpace(supervision.IssuingPartyID)) { errors.Add("contractor supervision IssuingPartyID"); } } return errors; }
public abstract Sans_Properties_OLifEBuilder AddParty(Party_Type entity);
protected PartyBuilder_Sans_Properties_PartyBuilder(Party_Type baseEntity) : base(baseEntity) { }
protected PartyBuilder_Sans_PartyTypeCode_PartyBuilder(Party_Type baseEntity) : base(baseEntity) { }
internal static IEnumerable<string> Licence(TXLife_Type response, Party_Type contractor) { List<string> errors = new List<string>(); if (contractor.Producer.License != null) { foreach (var licence in contractor.Producer.License) { if (string.IsNullOrWhiteSpace(licence.AgencyAffiliationID)) { errors.Add("contractor licence AgencyAffiliationID"); } else { var sponsor = response.Items.OfType<Party_Type>().FirstOrDefault(p => p.id == licence.AgencyAffiliationID); if (sponsor == null) { errors.Add("contractor licence sponsor"); } else { if (LUObjNotValid(sponsor.PartyTypeCode)) { errors.Add("contractor licence sponsor PartyTypeCode"); } if (!(sponsor.Item is Organization_Type)) { errors.Add("contractor licence sponsor Item"); } if (string.IsNullOrWhiteSpace(sponsor.FullName)) { errors.Add("contractor licence sponsor Item"); } } } if (string.IsNullOrWhiteSpace(licence.LicenseNum)) { errors.Add("contractor licence LicenceNum"); } if (LUObjNotValid(licence.LicenseType)) { errors.Add("contractor licence LicenceType"); } if (LUObjNotValid(licence.LicenseState)) { errors.Add("contractor licence LicenceState"); } if (string.IsNullOrWhiteSpace(licence.LevelDesc)) { errors.Add("contractor licence LevelDesc"); } } } return errors; }
public override Sans_Properties_OLifEBuilder AddParty(Party_Type entity) { AddItem(entity); return(this); }
internal static IEnumerable<string> OrganizationData(TXLife_Type response, Party_Type party) { List<string> errors = new List<string>(); if (string.IsNullOrWhiteSpace(party.PartyTypeCode.tc)) { errors.Add("organization partyTypeCode tc"); } if (party.Item == null) { errors.Add("organization item"); } else { if (party.Item.GetType() != typeof(Organization_Type)) { errors.Add("organization item type"); return errors; } var org = party.Item as Organization_Type; if (string.IsNullOrWhiteSpace(party.FullName)) { errors.Add("organization fullname"); } if (string.IsNullOrWhiteSpace(party.id)) { errors.Add("organization id"); } } return errors; }
internal static IEnumerable<string> CLHIA(TXLife_Type response, Party_Type contractor) { List<string> errors = new List<string>(); long contractorEntityId; if (!long.TryParse(Regex.Match(contractor.id, "C([0-9]+)").Groups[1].Value, out contractorEntityId)) { errors.Add("CLHIA contractorEntityId"); } else { if (contractor.Producer != null) { if (contractor.Producer.NationApproval == null) { errors.Add("CLHIA producer nationalApproval"); } else { foreach (var approval in contractor.Producer.NationApproval) { if (LUObjNotValid(approval.Nation)) { errors.Add("CLHIA producer nationalApproval"); } } } } } var formInstance = response.Items.OfType<FormInstance_Type>().FirstOrDefault(); if (formInstance != null) { if (string.IsNullOrWhiteSpace(formInstance.id)) { errors.Add("CLHIA formInstance id"); } if (formInstance.FormResponse == null) { errors.Add("CLHIA formResponse"); } else { foreach (var formResponse in formInstance.FormResponse) { if (string.IsNullOrWhiteSpace(formResponse.QuestionNumber)) { errors.Add("CLHIA formResponse questionNumber"); } if (string.IsNullOrWhiteSpace(formResponse.ResponseCode)) { errors.Add("CLHIA formResponse ResponseCode"); } if (string.IsNullOrWhiteSpace(formResponse.ResponseText)) { errors.Add("CLHIA formResponse ResponseText"); } if (string.IsNullOrWhiteSpace(formResponse.ResponseData)) { errors.Add("CLHIA formResponse ResponseData"); } } } var relation = response.Items.OfType<Relation_Type>().FirstOrDefault(p => p.OriginatingObjectID == contractor.id && p.RelatedObjectID == formInstance.id); errors.AddRange(Relation(relation, "CLHIA formInstance")); } return errors; }
internal static IEnumerable<string> PartnerData(Party_Type party) { List<string> errors = new List<string>(); if (string.IsNullOrWhiteSpace(party.id)) { errors.Add("partner id"); } if (string.IsNullOrWhiteSpace(party.FullName)) { errors.Add("partner FullName"); } if (party.Item == null || party.Item.GetType() != typeof(Organization_Type)) { errors.Add("partner item type"); } if (LUObjNotValid(party.PartyTypeCode)) { errors.Add("partnerPartyTypeCode"); } return errors; }
internal static IEnumerable<string> CreditRating(Party_Type contractor) { List<string> errors = new List<string>(); if (contractor.RatingAgencyInfo != null) { foreach(var info in contractor.RatingAgencyInfo) { if (LUObjNotValid(info.RatingSource)) { errors.Add("contractor creditRating ratingSource"); } if (string.IsNullOrWhiteSpace(info.RatingValue)) errors.Add("contractor creditRating RatingValue"); } } return errors; }
internal static IEnumerable<string> Shareholder(TXLife_Type response, Party_Type party) { List<string> errors = new List<string>(); if (LUObjNotValid(party.PartyTypeCode)) { errors.Add("Shareholder partyTypeCode"); } if (party.Item == null || !(party.Item is Person_Type)) { errors.Add("Shareholder item"); } if (string.IsNullOrWhiteSpace(party.FullName)) { errors.Add("Shareholder FullName"); } errors.AddRange(Email(party.EMailAddress, "Shareholder")); errors.AddRange(Relation(response.Items.OfType<Relation_Type>().Where(p => p.RelatedObjectID == party.id).FirstOrDefault(), "Shareholder")); return errors; }
protected PartyBuilder(Party_Type baseEntity) : base(baseEntity) { }
internal static IEnumerable<string> Appointments(TXLife_Type response, Party_Type contractor) { List<string> errors = new List<string>(); foreach (var app in contractor.Producer.CarrierAppointment) { if (string.IsNullOrWhiteSpace(app.id)) { errors.Add("Appointment id"); } if (string.IsNullOrWhiteSpace(app.PartyID)) { errors.Add("Appointment PartyID"); } if (LUObjNotValid(app.CarrierApptStatus)) { errors.Add("Appointment CarrierApptStatus"); } if (string.IsNullOrWhiteSpace(app.CompanyProducerID)) { errors.Add("Appointment CompanyProducerID"); } foreach (var govId in app.GovtIDInfo) { if (LUObjNotValid(govId)) { errors.Add("Appointment GovtIDInfo"); } } foreach (var assocInfo in app.AssocCarrierApptInfo) { if (string.IsNullOrWhiteSpace(assocInfo.CompanyProducerID)) { errors.Add("Appointment CompanyProducerID"); } if (LUObjNotValid(assocInfo.CarrierApptStatus)) { errors.Add("Appointment CarrierApptStatus"); } if (string.IsNullOrWhiteSpace(assocInfo.CarrierAppointmentID)) { errors.Add("Appointment CarrierAppointmentID"); } if (string.IsNullOrWhiteSpace(assocInfo.PartyID)) { errors.Add("Appointment PartyID"); } } // Referral foreach (var referral in app.ReferralInfo) { if (!referral.PartyID.StartsWith("REF")) { errors.Add("Appointment referral PartyID"); } var responseReferral = response.Items.OfType<Party_Type>().Where(p => p.id == referral.PartyID).FirstOrDefault(); if (responseReferral == null) { errors.Add("Appointment referral lifeItem"); } else { if (LUObjNotValid(responseReferral.PartyTypeCode)) { errors.Add("Appointment referral PartyTypeCode"); } if (responseReferral.Item == null || !(responseReferral.Item is Person_Type)) { errors.Add("Appointment referral Item"); } if (string.IsNullOrWhiteSpace(responseReferral.FullName)) { errors.Add("Appointment referral FullName"); } } } // Payment foreach (var distrib in app.DistributionAgreementInfo) { if (distrib.BankingInfoID != null) { var holding = response.Items.OfType<Holding_Type>().Where(p => p.id == distrib.BankingInfoID).FirstOrDefault(); if (holding == null) { errors.Add("Appointment payment holding"); } else { if (holding.Banking == null) { errors.Add("Appointment payment holding banking"); } else { if (string.IsNullOrWhiteSpace(holding.Banking.AccountNumber)) { errors.Add("Appointment payment holding banking AccountNumber"); } if (string.IsNullOrWhiteSpace(holding.Banking.TransitNumber)) { errors.Add("Appointment payment holding banking TransitNumber"); } if (string.IsNullOrWhiteSpace(holding.Banking.InstitutionNumber)) { errors.Add("Appointment payment holding banking InstitutionNumber"); } } if (holding.Attachment == null) { errors.Add("Appointment payment holding Attachment"); } else { foreach (var attachment in holding.Attachment) { errors.AddRange(Attachment(attachment, "Appointment payment holding banking")); } } } } if (distrib.CheckMailingID != null) { var address = response.Items.OfType<Address_Type>().Where(p => p.id == distrib.CheckMailingID).FirstOrDefault(); if (address == null) { errors.Add("Appointment payment address"); } else { errors.AddRange(Address(address, "Appointment payment")); } } if (LUObjNotValid(distrib.PaymentForm)) { errors.Add("Appointment PaymentForm"); } } // Hierarchy foreach (var distribLevel in app.DistributionLevel) { if (string.IsNullOrWhiteSpace(distribLevel.PartyID)) { errors.Add("Appointment hierarchy partyId"); } if (string.IsNullOrWhiteSpace(distribLevel.DistributionLevelValue)) { errors.Add("Appointment hierarchy DistributionLevelValue"); } } // Consolidations foreach (var consolidation in app.ConsolidationInfo) { if (string.IsNullOrWhiteSpace(consolidation.CarrierAppointmentID)) { errors.Add("Appointment consolidation CarrierAppointmentID"); } } // Transfers foreach (var transfer in app.TransferInfo) { if (string.IsNullOrWhiteSpace(transfer.CarrierAppointmentID)) { errors.Add("Appointment transfer CarrierAppointmentID"); } } // Debts foreach (var debt in app.DebtInfo) { errors.AddRange(Debt(response, response.Items.OfType<Holding_Type>().Where(p => p.id == debt.HoldingID).FirstOrDefault(), "Appointment")); } // Requirements var initialReq = response.Items.OfType<RequirementInfo_Type>().Where(p => p.ReqCode.tc == "936").FirstOrDefault(); if (initialReq == null) { errors.Add("Appointment Requirements Initial Business"); } foreach (var req in app.RequirementInfo) { if (string.IsNullOrWhiteSpace(req.FulfillerPartyID)) { errors.Add("Appointent Requirements FulfillerPartyID"); } if (req.Attachment == null) { errors.Add("Appointment Requirements Attachment"); } foreach (var attachment in req.Attachment) { errors.AddRange(Attachment(attachment, "Appointment Requirements")); foreach (var signature in attachment.SignatureInfo) { if (string.IsNullOrWhiteSpace(signature.DelegatedSignerPartyID)) { errors.Add("Appointent Requirements attachment DelegatedSignerPartyID"); } var signer = response.Items.OfType<Party_Type>().Where(p => p.id == signature.DelegatedSignerPartyID).FirstOrDefault(); if (signer == null) { errors.Add("Appointent Requirements attachment signer"); } else { if (string.IsNullOrWhiteSpace(signer.id)) { errors.Add("Appointent Requirements attachment signer id"); } if (string.IsNullOrWhiteSpace(signer.FullName)) { errors.Add("Appointent Requirements attachment signer FullName"); } errors.AddRange(Email(signer.EMailAddress, "Appointment Requirements attachment signer")); if (LUObjNotValid(signer.PartyTypeCode)) { errors.Add("Appointent Requirements attachment signer PartyTypeCode"); } if (signer.Item == null) { errors.Add("Appointent Requirements attachment signer Item"); } } } } } // CustomQuestions var formInstance = response.Items.OfType<FormInstance_Type>().Where(p => p.RelatedObjectID == app.id).FirstOrDefault(); if (formInstance == null) { errors.Add("Appointent CustomQuestions formInstance"); } if (string.IsNullOrWhiteSpace(formInstance.id)) { errors.Add("Appointent CustomQuestions formInstance id"); } if (LUObjNotValid(formInstance.RelatedObjectType)) { errors.Add("Appointent CustomQuestions formInstance RelatedObjectType"); } if (formInstance.FormResponse == null) { errors.Add("Appointent CustomQuestions formInstance FormResponse"); } foreach (var formResponse in formInstance.FormResponse) { if (string.IsNullOrWhiteSpace(formResponse.QuestionNumber)) { errors.Add("Appointent CustomQuestions formInstance FormResponse QuestionNumber"); } if (string.IsNullOrWhiteSpace(formResponse.ResponseText)) { errors.Add("Appointent CustomQuestions formInstance FormResponse QuestionNumber"); } } } return errors; }
public void V2_38_00_Relationship_Test1() { var builder = TXLife_Type.CreateBuilder() .Version("2.38.00") .AddTXLifeRequest(new TXLifeRequest_Type { TransRefGUID = "ACORD_001_Relation_Samples", TransType = OLI_LU_TRANS_TYPE_CODES._1203, TransSubType = TRANS_SUBTYPE_CODES._20300, TransExeDate = DateTime.Parse("2006-09-28"), TransExeTime = DateTime.Parse("12:35:02"), TransMode = TRANS_MODE_CODES.OLI_TRANS_MODE_ORIGINAL, InquiryLevel = INQUIRY_LEVEL_CODES._3, TestIndicator = OLI_LU_BOOLEAN.OLI_BOOL_TRUE, OLifE = OLifE_Type .CreateBuilder() .AddHolding(new Holding_Type { id = "Holding1", HoldingTypeCode = OLI_LU_HOLDTYPE.OLI_HOLDTYPE_POLICY, HoldingStatus = OLI_LU_HOLDSTAT.OLI_HOLDSTAT_PROPOSED, Policy = Policy_Type .CreateBuilder(new Policy_Type() { CarrierPartyID = "CarrierParty", ProductCode = "SPTE", CarrierCode = "12345", PlanName = "Special Term", PolicyStatus = OLI_LU_POLSTAT.OLI_POLSTAT_ACTIVE, }) .WithLife(new Life_Type { FaceAmt = 750000m, Coverage = { new Coverage_Type { id = "BaseCoverage", PlanName = "Special Term", IndicatorCode = OLI_LU_COVINDCODE.OLI_COVIND_BASE, LifeParticipant = { new LifeParticipant_Type { id = "LifeParticipant1", PartyID = "PartyA", LifeParticipantRoleCode = OLI_LU_PARTICROLE.OLI_PARTICROLE_PRIMARY } } } } }) .Build(), }) .AddParty(new Party_Type { id = "CarrierParty", PartyTypeCode = OLI_LU_PARTY.OLI_PT_ORG, FullName = "ACME Life Insurance", Carrier = new Carrier_Type { CarrierCode = "12345" }, Item = new Organization_Type() }) .AddParty( Party_Type .CreateBuilder(new Party_Type { id = "PartyA", GovtID = "111111111", GovtIDTC = OLI_LU_GOVTIDTC.OLI_GOVTID_SSN, }) .WithPerson(new Person_Type { FirstName = "Joseph", LastName = "Smith", Gender = OLI_LU_GENDER.OLI_GENDER_MALE, BirthDate = DateTime.Parse("1954-03-28"), Citizenship = OLI_LU_NATION.OLI_NATION_USA }) ) .AddParty( new Party_Type { id = "PartyB", PartyTypeCode = OLI_LU_PARTY.OLI_PT_PERSON, Item = new Person_Type { FirstName = "Josephine", LastName = "Smith", Gender = OLI_LU_GENDER.OLI_GENDER_FEMALE } } ) .AddParty( new Party_Type { id = "PartyC", PartyTypeCode = OLI_LU_PARTY.OLI_PT_PERSON, Item = new Person_Type { FirstName = "Jill", LastName = "Smith", Gender = OLI_LU_GENDER.OLI_GENDER_FEMALE } } ) .BeginRelation("Relation_Estate") .IsA(OLI_LU_REL.OLI_REL_TERTBENE) .For("Holding1") .EndRelation(new Relation_Type { InterestPercent = 100.0d, BeneficiaryDesignation = OLI_LU_BENEDESIGNATION.OLI_BENEDES_ESTATE }) .BeginRelation("Relation1") .Where("PartyA") .IsA(OLI_LU_REL.OLI_REL_PARENT).WithDescription(OLI_LU_RELDESC.OLI_RELDESC_FATHER) .Of("PartyB") .EndRelation() .BeginRelation("Relation2") .Where("PartyB") .IsA(OLI_LU_REL.OLI_REL_CHILD).WithDescription(OLI_LU_RELDESC.OLI_RELDESC_DAUGHTER) .Of("PartyA") .EndRelation() .BeginRelation("Relation4") .IsA(OLI_LU_REL.OLI_REL_INSURED) .For("Holding1") .EndRelation() .BeginRelation("Relation5") .IsA(OLI_LU_REL.OLI_REL_OWNER) .For("Holding1") .EndRelation() .BeginRelation("Relation6") .IsA(OLI_LU_REL.OLI_REL_BENEFICIARY) .For("Holding1") .EndRelation(new Relation_Type { InterestPercent = 100.0d, BeneficiaryDesignation = OLI_LU_BENEDESIGNATION.OLI_BENEDES_NAMED }) .BeginRelation("Relation7") .IsA(OLI_LU_REL.OLI_REL_CONTGNTBENE) .For("Holding1") .EndRelation(new Relation_Type { InterestPercent = 100.0d, BeneficiaryDesignation = OLI_LU_BENEDESIGNATION.OLI_BENEDES_NAMED }) .BeginRelation("Relation8") .Where("PartyC") .IsA(OLI_LU_REL.OLI_REL_SPOUSE).WithDescription(OLI_LU_RELDESC.OLI_RELDESC_WIFE) .Of("PartyA") .EndRelation() .BeginRelation("Relation9") .Where("PartyA") .IsA(OLI_LU_REL.OLI_REL_SPOUSE).WithDescription(OLI_LU_RELDESC.OLI_RELDESC_HUSBAND) .Of("PartyC") .EndRelation() .Build() // End of olife }); // Arrange var txLife = builder.Build(); // Act string xmlString; txLife.Serialize(out xmlString); // Assert Assert.DoesNotContain("<HoldingKey", xmlString); Assert.Contains("id=\"Relation9\"", xmlString); }