Esempio n. 1
0
        public async Task Test_GetPAFAddress()
        {
            paf = 123;
            PostalAddressDTO expectedresult = await testCandidate.GetPAFAddress(paf);

            Assert.IsNotNull(expectedresult);
        }
Esempio n. 2
0
        public async Task <PostalAddressDTO> GetPAFAddress(int udprn)
        {
            try
            {
                using (loggingHelper.RMTraceManager.StartTrace("Controller.GetPAFAddress"))
                {
                    string methodName = typeof(PostalAddressController) + "." + nameof(GetPAFAddress);
                    loggingHelper.LogMethodEntry(methodName, priority, entryEventId);

                    var postalAddress = await businessService.GetPAFAddress(udprn);

                    loggingHelper.LogMethodExit(methodName, priority, exitEventId);
                    return(postalAddress);
                }
            }
            catch (AggregateException ex)
            {
                foreach (var exception in ex.InnerExceptions)
                {
                    loggingHelper.Log(exception, TraceEventType.Error);
                }

                var realExceptions = ex.Flatten().InnerException;
                throw realExceptions;
            }
        }