public void Test_GetStreetNameCount() { var result = testCandidate.GetStreetNameCount("abc", Guid.NewGuid(), "Delivery Office"); Assert.IsNotNull(result); Assert.AreEqual(result.Result, 5); }
public async Task <IActionResult> GetStreetNameCount(string searchText) { using (loggingHelper.RMTraceManager.StartTrace("Controller.GetStreetNameCount")) { string methodName = typeof(NetworkManagerController) + "." + nameof(GetStreetNameCount); loggingHelper.LogMethodEntry(methodName, priority, entryEventId); try { int streetCount = await networkManagerBusinessService.GetStreetNameCount(searchText, this.CurrentUserUnit, this.CurrentUserUnitType).ConfigureAwait(false); loggingHelper.LogMethodExit(methodName, priority, exitEventId); return(Ok(streetCount)); } catch (AggregateException ae) { foreach (var exception in ae.InnerExceptions) { loggingHelper.Log(exception, TraceEventType.Error); } var realExceptions = ae.Flatten().InnerException; throw realExceptions; } } }