/// <summary> /// Get filtered route count /// </summary> /// <param name="searchText">The text to be searched</param> /// <param name="locationId">selected unit's location ID</param> /// <returns>The total count of delivery route</returns> public async Task <int> GetRouteCount(string searchText, Guid locationId) { if (string.IsNullOrEmpty(searchText)) { throw new ArgumentNullException(nameof(searchText)); } if (locationId == Guid.Empty) { throw new ArgumentNullException(nameof(locationId)); } using (loggingHelper.RMTraceManager.StartTrace("Business.GetRouteCount")) { string methodName = typeof(DeliveryRouteBusinessService) + "." + nameof(GetRouteCount); loggingHelper.LogMethodEntry(methodName, LoggerTraceConstants.DeliveryRouteAPIPriority, LoggerTraceConstants.DeliveryRouteBusinessServiceMethodEntryEventId); int routeCount = await deliveryRouteDataService.GetRouteCount(searchText, locationId); loggingHelper.LogMethodExit(methodName, LoggerTraceConstants.DeliveryRouteAPIPriority, LoggerTraceConstants.DeliveryRouteBusinessServiceMethodExitEventId); return(routeCount); } }
public async Task TestGetRouteCount_PositiveScenario() { var actualResult = await testCandidate.GetRouteCount("141", new Guid("F08AAD61-B83F-463D-95D6-F0583F24644F")); Assert.IsTrue(actualResult == 1); }