示例#1
0
        public async Task EmailNotificationDisabled()
        {
            _webApiSettings.SecurityNotificationsEnabled = false;
            _filter = new EmailNotificationFilterImpl(_notificationService.Object, _webApiOptions.Object,
                                                      new NotificationFilter[0]);
            await _filter.OnActionExecutionAsync(_context, Target);

            _notificationService.VerifyAll();
        }
示例#2
0
        public async Task EmailNotificationEnabledNoFilters2()
        {
            _webApiSettings.SecurityNotificationsEnabled = true;
            _webApiSettings.NotificationFilters          = new List <NotificationFilter>();
            _filter = new EmailNotificationFilterImpl(_notificationService.Object, _webApiOptions.Object,
                                                      new[] { NotificationFilter.ExecuteScript });
            _notificationService.Setup(x => x.SendEmailAsync(It.IsAny <string>(), It.IsAny <string>())).Returns(Task.CompletedTask);

            await _filter.OnActionExecutionAsync(_context, Target);

            _notificationService.VerifyAll();
        }
示例#3
0
        public async Task EmailNotificationEnabledFilteredOut()
        {
            _webApiSettings.SecurityNotificationsEnabled = true;
            _webApiSettings.NotificationFilters          = new List <NotificationFilter>()
            {
                NotificationFilter.ExecuteScript
            };
            _filter = new EmailNotificationFilterImpl(_notificationService.Object, _webApiOptions.Object,
                                                      new[] { NotificationFilter.FailedGetToken });
            await _filter.OnActionExecutionAsync(_context, Target);

            _notificationService.VerifyAll();
        }