コード例 #1
0
        public async Task Process_CompletesNotification(
            ReceivedNotificationStub notification,
            NotificationHandlerStub[] handlers,
            ReceivedNotificationProcessor processor)
        {
            processor.RegisterHandlers(handlers);

            await ProcessNotifications(notification, processor);

            Assert.True(notification.IsCompleted);
        }
コード例 #2
0
        public async Task Process_WhenHandlerFailes_RetriesNotification(
            ReceivedNotificationStub notification,
            NotificationHandlerStub handler,
            ReceivedNotificationProcessor processor)
        {
            processor.RegisterHandlers(handler.YieldArray());

            await ProcessNotifications(notification, processor);

            Assert.True(notification.IsRetried);
        }
コード例 #3
0
        public async Task Process_SendsNotificationToHandlers(
            ReceivedNotificationStub notification,
            NotificationHandlerStub[] handlers,
            ReceivedNotificationProcessor processor)
        {
            processor.RegisterHandlers(handlers);

            await ProcessNotifications(notification, processor);

            foreach (var handler in handlers)
            {
                Assert.True(handler.ReceivedNotifications.Contains(notification.Notification));
            }
        }