public async Task <IActionResult> CheckIfNotificationExists(int udprn, string actionname) { using (loggingHelper.RMTraceManager.StartTrace("WebService.CheckIfNotificationExists")) { string methodName = MethodHelper.GetActualAsyncMethodName(); loggingHelper.Log(methodName + LoggerTraceConstants.COLON + LoggerTraceConstants.MethodExecutionStarted, TraceEventType.Verbose, null, LoggerTraceConstants.Category, LoggerTraceConstants.NotificationAPIPriority, LoggerTraceConstants.NotificationControllerMethodEntryEventId, LoggerTraceConstants.Title); try { bool notificationExists = await notificationBusinessService.CheckIfNotificationExists(udprn, actionname); loggingHelper.Log(methodName + LoggerTraceConstants.COLON + LoggerTraceConstants.MethodExecutionCompleted, TraceEventType.Verbose, null, LoggerTraceConstants.Category, LoggerTraceConstants.NotificationAPIPriority, LoggerTraceConstants.NotificationControllerMethodExitEventId, LoggerTraceConstants.Title); return(Ok(notificationExists)); } catch (AggregateException ae) { foreach (var exception in ae.InnerExceptions) { loggingHelper.Log(exception, TraceEventType.Error); } var realExceptions = ae.Flatten().InnerException; throw realExceptions; } } }
public void Test_CheckIfNotificationExists() { var result = testCandidate.CheckIfNotificationExists(1, "abc"); Assert.NotNull(result); Assert.IsTrue(result.Result); }