public async Task <IActionResult> GetPostalAddress(int?uDPRN) { try { using (loggingHelper.RMTraceManager.StartTrace("Controller.GetPostalAddress")) { string methodName = typeof(PostalAddressController) + "." + nameof(GetPostalAddress); loggingHelper.LogMethodEntry(methodName, priority, entryEventId); PostalAddressDTO postalAddressDTO = await businessService.GetPostalAddress(uDPRN); loggingHelper.LogMethodExit(methodName, priority, exitEventId); return(Ok(postalAddressDTO)); } } catch (AggregateException ex) { foreach (var exception in ex.InnerExceptions) { loggingHelper.Log(exception, System.Diagnostics.TraceEventType.Error); } var realExceptions = ex.Flatten().InnerException; throw realExceptions; } }
public void Test_GetPostalAddress_PositiveScenario() { var result = testCandidate.GetPostalAddress(12345); Assert.IsNotNull(result); }