public RiskMother() { ClientReference = "XYZ"; VehicleDetails = new VehicleDetailsMother().Build(); VehicleUsage = new VehicleUsageMother().Build(); PersonDetails = new PersonalDetailsMother().Build(); Claim = new ClaimMother().Build(); Conviction = new ConvictionMother().Build(); DrivingHistory = new DrivingHistoryMother().Build(); PolicyDetails = new PolicyDetailsMother().Build(); ContactDetails = new ContactDetailsMother().Build(); }
private AdditionalDriver BuildAdditionalDriver(DataRecord data, String currentDriver) { HasAdditionalDriver = Convert.ToBoolean(data["HASADDITIONALDRIVERS"]); RelationshipDescription = data["ADD" + currentDriver + "RELATIONSHIP"]; AdditionalDriverTitleDescription = data["ADD" + currentDriver + "TITLE"]; AdditionalDriverFirstName = data["ADD" + currentDriver + "FIRSTNAME"]; AdditionalDriverLastName = data["ADD" + currentDriver + "SURNAME"]; AdditionalDriverDateOfBirth = Extension.GetDateTime(data["ADD" + currentDriver + "DOB"]); //[61] AdditionalDriverMaritalStatusDescription = data["ADD" + currentDriver + "MARITALSTATUS"]; AdditionalDriverOccupationTitleDescription = data["ADD" + currentDriver + "OCCUPATION"]; AdditionalDriverBusinessTypeDescription = data["ADD" + currentDriver + "BUSINESSTYPE"]; if (ConfigurationManager.AppSettings["QSTestEnabled"].Equals("True", StringComparison.OrdinalIgnoreCase)) { AdditionalDriverDrivingLicenceTypeDescription = data["ADD" + currentDriver + "LICENCETYPE"]; AdditionalDriverDrivingLicenceWhereIssuedDescription = data["QS_ADD" + currentDriver + "LICENCEISSUED"]; AdditionalDriverDrivingLicenceManualOrAutoDescription = data["ADD" + currentDriver + "LICENCETRANSMISSIONRESTRICTION"]; AdditionalDriverEmploymentStatusDescription = data["QS_ADD" + currentDriver + "EMPLOYMENTSTATUS"]; if (AdditionalDriverEmploymentStatusDescription.Trim().ToUpper().Equals(Constants.CurrentlyNotWorking)) { AdditionalDriverWhyNotWorking = data["QS_ADD" + currentDriver + "WHYNOTWORKING"]; } else if (AdditionalDriverEmploymentStatusDescription.Trim().ToUpper().Equals(Constants.FullOrPartTimeEducation)) { AdditionalDriverStudentTypeCodeDescription = data["ADD" + currentDriver + "STUDENTTYPE"]; } } else { AdditionalDriverDrivingLicenceTypeDescription = data["ADD" + currentDriver + "LICENCETYPE_OLD"]; AdditionalDriverEmploymentStatusDescription = data["ADD" + currentDriver + "EMPLOYMENTSTATUS"]; if (AdditionalDriverEmploymentStatusDescription.Trim().ToUpper().Equals(Constants.CurrentlyNotWorking)) { AdditionalDriverWhyNotWorking = data["ADD" + currentDriver + "WHYNOTWORKING"]; } } AdditionalDriverLicenceYearsHeldDescription = data["ADD" + currentDriver + "LICENCEHELD"]; bool matched = Extension.LicenceHeldYearsMatched(AdditionalDriverLicenceYearsHeldDescription); if (matched) { AdditionalDriverLicenceDate = Extension.GetDateTime(data["ADD" + currentDriver + "LICENCEDATE"]); } AdditionalDriverUseOfAnyOtherVehicleDescription = data["ADD" + currentDriver + "USEOFOTHERVEHICLES"]; AdditionalDriverMedicalConditionsDecription = data["ADD" + currentDriver + "MEDICALCONDITIONS"]; AdditionalDriverClaims = new ClaimMother().GetAdditionalDriverClaims(data, currentDriver); AdditionalDriverConvictions = new ConvictionMother().GetAdditionalDriverConvictions(data, currentDriver); AdditionalDriverResidentSinceBirth = Convert.ToBoolean(data["ADD" + currentDriver + "RESIDENTSINCEBIRTH"]); if (!AdditionalDriverResidentSinceBirth) { AdditionalDriverResidentSinceDate = Extension.GetDateTime(data["ADD" + currentDriver + "RESIDENTSINCEDATE"]); } AdditionalDriverHasNonMotorConvictions = Convert.ToBoolean(data["ADD" + currentDriver + "CRIMINALCONVICTIONS"]); return new AdditionalDriver() { HasAdditionalDriver = HasAdditionalDriver, RelationshipDescription = RelationshipDescription, AdditionalDriverTitleDescription = AdditionalDriverTitleDescription, AdditionalDriverFirstName = AdditionalDriverFirstName, AdditionalDriverLastName = AdditionalDriverLastName, AdditionalDriverDateOfBirth = AdditionalDriverDateOfBirth, AdditionalDriverMaritalStatusDescription = AdditionalDriverMaritalStatusDescription, AdditionalDriverStudentTypeCodeDescription = AdditionalDriverStudentTypeCodeDescription, AdditionalDriverEmploymentStatusDescription = AdditionalDriverEmploymentStatusDescription, AdditionalDriverOccupationTitleDescription = AdditionalDriverOccupationTitleDescription, AdditionalDriverBusinessTypeDescription = AdditionalDriverBusinessTypeDescription, AdditionalDriverDrivingLicenceTypeDescription = AdditionalDriverDrivingLicenceTypeDescription, AdditionalDriverDrivingLicenceWhereIssuedDescription = AdditionalDriverDrivingLicenceWhereIssuedDescription, AdditionalDriverDrivingLicenceManualOrAutoDescription = AdditionalDriverDrivingLicenceManualOrAutoDescription, AdditionalDriverLicenceYearsHeldDescription = AdditionalDriverLicenceYearsHeldDescription, AdditionalDriverUseOfAnyOtherVehicleDescription = AdditionalDriverUseOfAnyOtherVehicleDescription, AdditionalDriverMedicalConditionsDecription = AdditionalDriverMedicalConditionsDecription, AdditionalDriverClaims = AdditionalDriverClaims, AdditionalDriverConvictions = AdditionalDriverConvictions, AdditionalDriverWhyNotWorking = AdditionalDriverWhyNotWorking, AdditionalDriverLicenceDate = AdditionalDriverLicenceDate, AdditionalDriverResidentSinceBirth = AdditionalDriverResidentSinceBirth, AdditionalDriverResidentSinceDate = AdditionalDriverResidentSinceDate, AdditionalDriverHasNonMotorConvictions = AdditionalDriverHasNonMotorConvictions, }; }