public void Test_FetchStreetNamesForBasicSearch()
        {
            var result = testCandidate.GetStreetNamesForBasicSearch("abc", Guid.NewGuid(), "Delivery Office");

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Result[0].LocalName, "abc");
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetStreetNamesForBasicSearch(string searchText)
        {
            using (loggingHelper.RMTraceManager.StartTrace("Controller.GetStreetNamesForBasicSearch"))
            {
                string methodName = typeof(NetworkManagerController) + "." + nameof(GetStreetNamesForBasicSearch);
                loggingHelper.LogMethodEntry(methodName, priority, entryEventId);

                try
                {
                    List <StreetNameDTO> streetNames = await networkManagerBusinessService.GetStreetNamesForBasicSearch(searchText, this.CurrentUserUnit, this.CurrentUserUnitType).ConfigureAwait(false);

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

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