public async Task Test_GetPostalAddressSearchDetails() { var result = await testCandidate.GetPostalAddressSearchDetails("12", new Guid("1534AA41-391F-4579-A18D-D7EDF5B5F918"), new List <Guid>() { postcodeTypeGUID }); Assert.IsNotNull(result); Assert.IsTrue(result.ToList().Count == 1); Assert.AreEqual(result.ToList()[0], "12,123"); }
/// <summary> /// /// </summary> /// <param name="searchText"></param> /// <param name="unitGuid"></param> /// <returns></returns> public async Task <List <string> > GetPostalAddressSearchDetails(string searchText, Guid unitGuid) { using (loggingHelper.RMTraceManager.StartTrace("Business.GetPostalAddressSearchDetails")) { string methodName = typeof(UnitLocationBusinessService) + "." + nameof(GetPostalAddressSearchDetails); loggingHelper.LogMethodEntry(methodName, LoggerTraceConstants.UnitManagerAPIPriority, LoggerTraceConstants.UnitManagerBusinessServiceMethodEntryEventId); List <string> listNames = new List <string> { FileType.Paf.ToString().ToUpper(), FileType.Nyb.ToString().ToUpper() }; var referenceDataCategoryList = unitManagerIntegrationService.GetReferenceDataSimpleLists(ReferenceDataCategoryNames.PostalAddressType).Result; List <Guid> addresstypeIDs = referenceDataCategoryList.ReferenceDatas .Where(a => listNames.Contains(a.ReferenceDataValue)) .Select(a => a.ID).ToList(); var postalAddress = await postalAddressDataService.GetPostalAddressSearchDetails(searchText, unitGuid, addresstypeIDs); loggingHelper.LogMethodExit(methodName, LoggerTraceConstants.UnitManagerAPIPriority, LoggerTraceConstants.UnitManagerBusinessServiceMethodExitEventId); return(postalAddress); } }