public void Test_GetPostCodeID() { var result = testCandidate.GetPostcodeID("123"); Assert.NotNull(result.Result); Assert.AreEqual(result.Result, new Guid("B51AA229-C984-4CA6-9C12-510187B81050")); }
public async Task <Guid> GetPostcodeID(string searchText) { string methodName = typeof(UnitManagerController) + "." + nameof(GetPostcodeID); using (loggingHelper.RMTraceManager.StartTrace("WebService.GetPostcodeID")) { loggingHelper.LogMethodEntry(methodName, LoggerTraceConstants.UnitManagerAPIPriority, LoggerTraceConstants.UnitManagerControllerMethodEntryEventId); if (string.IsNullOrEmpty(searchText)) { throw new ArgumentNullException(nameof(searchText)); } try { var getPostCodeID = await unitLocationBusinessService.GetPostcodeID(searchText); loggingHelper.LogMethodEntry(methodName, LoggerTraceConstants.UnitManagerAPIPriority, LoggerTraceConstants.UnitManagerControllerMethodExitEventId); return(getPostCodeID); } catch (AggregateException ae) { foreach (var exception in ae.InnerExceptions) { loggingHelper.Log(exception, TraceEventType.Error); } var realExceptions = ae.Flatten().InnerException; throw realExceptions; } } }