private void UserContactLocationInfo_UserAddress_Phones_Test(IEnumerable <XElement> oldServiceNodes, IEnumerable <UserAddress> newServiceNodes) { // phone numbers are specific to a UserAddress which is the equivalent of the Location in the old service // the locationName became the OfficeName var watch = new Stopwatch(); watch.Start(); var oldValues = new List <string>(); oldValues.AddRange(ParsingHelper.ParseUnstructuredListOfValues(oldServiceNodes, EnumOldServiceFieldsAsKeys.location.ToString(), EnumOldServiceFieldsAsKeys.phoneNumber.ToString())); oldValues.AddRange(ParsingHelper.ParseUnstructuredListOfValues(oldServiceNodes, EnumOldServiceFieldsAsKeys.location.ToString(), EnumOldServiceFieldsAsKeys.phone2Number.ToString())); var newValues = new List <string>(); var allPhones = newServiceNodes.Select(x => x.Phones); foreach (var list in allPhones) { newValues.AddRange(list.Select(x => ParsingHelper.FormatPhoneNumber(x.Number))); } CompareAndLog_Test(EnumTestUnitNames.UserContactLocationInfo_Addresses_Phones, "Comparing Address Phone Number(s)", new HashSet <string>(oldValues.Where(x => !string.IsNullOrWhiteSpace(x))), new HashSet <string>(newValues), watch); }
protected override void RunAllSingleTests() { this.CompareAndLog_Test(EnumTestUnitNames.UserContactLocationInfo_GeneralContact_OfficePhone, "Comparing General Contact", this.OldDataNodes, EnumOldServiceFieldsAsKeys.officePhone.ToString(), ParsingHelper.FormatPhoneNumber((this.newData != null?this.newData.AcademicPhone:string.Empty), (this.newData != null?this.newData.AcademicPhoneExtension:string.Empty))); this.CompareAndLog_Test(EnumTestUnitNames.UserContactLocationInfo_GeneralContact_ClinicPhone, "Comparing General Contact", this.OldDataNodes, EnumOldServiceFieldsAsKeys.clinicPhone.ToString(), ParsingHelper.FormatPhoneNumber((this.newData != null?this.newData.ClinicPhone:string.Empty), (this.newData != null?this.newData.ClinicPhoneExtension:string.Empty))); this.CompareAndLog_Test(EnumTestUnitNames.UserContactLocationInfo_GeneralContact_LabPhone, "Comparing General Contact", this.OldDataNodes, EnumOldServiceFieldsAsKeys.labPhone.ToString(), ParsingHelper.FormatPhoneNumber((this.newData != null?this.newData.LabPhone:string.Empty), (this.newData != null?this.newData.LabPhoneExtension:string.Empty))); this.CompareAndLog_Test(EnumTestUnitNames.UserContactLocationInfo_GeneralContact_OfficeFax, "Comparing General Contact", this.OldDataNodes, EnumOldServiceFieldsAsKeys.officeFax.ToString(), ParsingHelper.FormatPhoneNumber((this.newData != null?this.newData.OfficeFax:string.Empty))); this.CompareAndLog_Test(EnumTestUnitNames.UserContactLocationInfo_GeneralContact_ClinicFax, "Comparing General Contact", this.OldDataNodes, EnumOldServiceFieldsAsKeys.clinicFax.ToString(), ParsingHelper.FormatPhoneNumber((this.newData != null?this.newData.ClinicFax:string.Empty))); this.CompareAndLog_Test(EnumTestUnitNames.UserContactLocationInfo_GeneralContact_MobilePhone, "Comparing General Contact", "False", (this.newData != null ? this.newData.IsMobilePhoneDisplayed.ToString() : string.Empty)); this.CompareAndLog_Test(EnumTestUnitNames.UserContactLocationInfo_GeneralContact_Pager, "Comparing General Contact", "False", (this.newData != null ? this.newData.IsPagerDisplayed.ToString() : string.Empty)); ComputeOverallSeverity(); }