public void ProcessQueuedEmailNotificationsTestInvalidInput() { MeetingInviteController meetingInviteController = new MeetingInviteController(this.emailServiceManager.Object, this.logger); QueueNotificationItem queueNotificationItem = new QueueNotificationItem { NotificationIds = new string[] { Guid.NewGuid().ToString() } }; _ = Assert.ThrowsAsync <ArgumentException>(async() => await meetingInviteController.ProcessQueuedMeetingNotifications(null, queueNotificationItem)); _ = Assert.ThrowsAsync <ArgumentNullException>(async() => await meetingInviteController.ProcessQueuedMeetingNotifications("TestApp", null)); }
public void ProcessQueuedEmailNotificationsTestValidInput() { MeetingInviteController meetingInviteController = new MeetingInviteController(this.emailServiceManager.Object, this.logger); IList <NotificationResponse> responses = new List <NotificationResponse>(); string applicationName = "TestApp"; QueueNotificationItem queueNotificationItem = new QueueNotificationItem { NotificationIds = new string[] { Guid.NewGuid().ToString() } }; _ = this.emailServiceManager .Setup(emailServiceManager => emailServiceManager.ProcessMeetingNotifications(It.IsAny <string>(), It.IsAny <QueueNotificationItem>())) .Returns(Task.FromResult(responses)); Task <IList <NotificationResponse> > result = meetingInviteController.ProcessQueuedMeetingNotifications(applicationName, queueNotificationItem); Assert.AreEqual(result.Status.ToString(), "RanToCompletion"); this.emailServiceManager.Verify(mgr => mgr.ProcessMeetingNotifications(It.IsAny <string>(), It.IsAny <QueueNotificationItem>()), Times.Once); Assert.Pass(); }