public void GetAllTemplateEntitiesTest() { NotificationReportController notificationReportController = new NotificationReportController(this.notificationReportManager.Object, this.logger); IList <MailTemplateInfo> mailTemplatesInfo = new List <MailTemplateInfo>(); _ = this.notificationReportManager .Setup(notificationReportManager => notificationReportManager.GetAllTemplateEntities(It.IsAny <string>())) .Returns(Task.FromResult(mailTemplatesInfo)); var result = notificationReportController.GetAllTemplateEntities(this.applicationName); Assert.AreEqual(result.Status.ToString(), "RanToCompletion"); this.notificationReportManager.Verify(mgr => mgr.GetAllTemplateEntities(this.applicationName), Times.Once); Assert.Pass(); }
public void GetNotificationMessageTest() { NotificationReportController notificationReportController = new NotificationReportController(this.notificationReportManager.Object, this.logger); EmailMessage notificationMessage = new EmailMessage(); _ = this.notificationReportManager .Setup(notificationReportManager => notificationReportManager.GetNotificationMessage(It.IsAny <string>(), It.IsAny <string>())) .Returns(Task.FromResult(notificationMessage)); var result = notificationReportController.GetNotificationMessage(this.applicationName, this.notificationId); Assert.AreEqual(result.Status.ToString(), "RanToCompletion"); this.notificationReportManager.Verify(mgr => mgr.GetNotificationMessage(It.IsAny <string>(), It.IsAny <string>()), Times.Once); Assert.Pass(); }
public void GetReportNotificationsTest() { NotificationReportController notificationReportController = new NotificationReportController(this.notificationReportManager.Object, this.logger); IList <NotificationReportResponse> response = new List <NotificationReportResponse>(); Tuple <IList <NotificationReportResponse>, TableContinuationToken> notificationResponses = new Tuple <IList <NotificationReportResponse>, TableContinuationToken>(response, null); _ = this.notificationReportManager .Setup(notificationReportManager => notificationReportManager.GetReportNotifications(It.IsAny <NotificationReportRequest>())) .Returns(Task.FromResult(notificationResponses)); var result = notificationReportController.GetReportNotifications(this.request); Assert.AreEqual(result.Status.ToString(), "RanToCompletion"); this.notificationReportManager.Verify(mgr => mgr.GetReportNotifications(this.request), Times.Once); Assert.Pass(); }