Пример #1
0
        public void GetWorkItems_FilterSingleNotification(IEnumerable <WebHook> webHooks, IWebHookNotification notification)
        {
            // Act
            IEnumerable <WebHookWorkItem> actual = WebHookManager.GetWorkItems(webHooks.ToArray(), new[] { notification });

            // Assert
            Assert.Equal(webHooks.Count(), actual.Count());
            foreach (WebHookWorkItem workItem in actual)
            {
                Assert.Same(workItem.Notifications.Single(), notification);
            }
        }
Пример #2
0
        public void GetWorkItems_FilterMultipleNotifications(IEnumerable <WebHook> webHooks, IEnumerable <IWebHookNotification> notifications, int expected)
        {
            // Act
            IEnumerable <WebHookWorkItem> actual = WebHookManager.GetWorkItems(webHooks.ToArray(), notifications.ToArray());

            // Assert
            Assert.Equal(expected, actual.Count());
            foreach (WebHookWorkItem workItem in actual)
            {
                foreach (IWebHookNotification notification in workItem.Notifications)
                {
                    Assert.True(workItem.WebHook.MatchesAction(notification.Action));
                }
            }
        }