Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        public void Test_GetPostalAddress_PositiveScenario()
        {
            var result = testCandidate.GetPostalAddress(12345);

            Assert.IsNotNull(result);
        }