示例#1
0
        public async Task Test_DeliveryPointExists_PositiveScenario()
        {
            bool result = await testCandidate.DeliveryPointExists(12345);

            Assert.IsNotNull(result);
            Assert.IsTrue(result);
        }
示例#2
0
        public async Task <IActionResult> DeliveryPointExists(int udprn)
        {
            using (loggingHelper.RMTraceManager.StartTrace("WebService.DeliveryPointExists"))
            {
                string methodName = typeof(DeliveryPointController) + "." + nameof(DeliveryPointExists);
                loggingHelper.LogMethodEntry(methodName, priority, entryEventId);

                try
                {
                    bool deliveryPointExists = await businessService.DeliveryPointExists(udprn);

                    loggingHelper.LogMethodExit(methodName, priority, exitEventId);

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

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