Exemplo n.º 1
0
        public async Task <IActionResult> GetDeliveryPointByUDPRNforBatch(int udprn)
        {
            try
            {
                using (loggingHelper.RMTraceManager.StartTrace("WebService.GetDeliveryPointByUDPRNforBatch"))
                {
                    string methodName = typeof(DeliveryPointController) + "." + nameof(GetDeliveryPointByUDPRNforBatch);
                    loggingHelper.LogMethodEntry(methodName, priority, entryEventId);

                    DeliveryPointDTO deliveryPointDTO = await businessService.GetDeliveryPointByUDPRNforBatch(udprn);

                    loggingHelper.LogMethodExit(methodName, priority, exitEventId);

                    return(Ok(deliveryPointDTO));
                }
            }
            catch (AggregateException ae)
            {
                foreach (var exception in ae.InnerExceptions)
                {
                    loggingHelper.Log(exception, TraceEventType.Error);
                }

                var realExceptions = ae.Flatten().InnerException;
                throw realExceptions;
            }
        }
Exemplo n.º 2
0
        public void Test_GetDeliveryPointByUDPRNforBatch_PositiveScenario()
        {
            var result = testCandidate.GetDeliveryPointByUDPRNforBatch(12345);

            Assert.IsNotNull(result);
        }