Exemplo n.º 1
0
        public async Task Test_GetDeliveryPointsCount_PositiveScenario()
        {
            int result = await testCandidate.GetDeliveryPointsCount("abc", Guid.NewGuid(), "Delivery Office");

            Assert.IsNotNull(result);
            Assert.IsTrue(result == 2);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetDeliveryPointsCount(string searchText)
        {
            using (loggingHelper.RMTraceManager.StartTrace("WebService.GetDeliveryPointsCount"))
            {
                string methodName = typeof(DeliveryPointController) + "." + nameof(GetDeliveryPointsCount);
                loggingHelper.LogMethodEntry(methodName, priority, entryEventId);

                try
                {
                    int deliveryPointCount = await businessService.GetDeliveryPointsCount(searchText, this.CurrentUserUnit, this.CurrentUserUnitType);

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

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