private void EventReceived(object sender, EventReceivedEventArgs e) { _log.Debug($"Event received {e.Event}"); if (e.Event.Type == NotificationType.OCCUPANCY || e.Event.Type == NotificationType.CONTROL) { _notificationManagerKeeper.HandleIncomingEvent(e.Event); } else { _notificationPorcessor.Proccess(e.Event); } }
public void HandleIncominEvent_ControlStreamingPaused_ShouldDispatchEvent() { // Arrange. _pushEnabled = null; var notification = new ControlNotification { Channel = "control_pri", ControlType = ControlType.STREAMING_PAUSED, Type = NotificationType.CONTROL }; // Act. _notificationManagerKeeper.HandleIncomingEvent(notification); // Assert. Assert.IsFalse(_pushEnabled.Value); }
public void HandleIncominEvent_ControlStreamingPaused_ShouldDispatchEvent() { // Arrange. _event = null; var notification = new ControlNotification { Channel = "control_pri", ControlType = ControlType.STREAMING_PAUSED, Type = NotificationType.CONTROL }; // Act. _notificationManagerKeeper.HandleIncomingEvent(notification); // Assert. Assert.AreEqual(SSEClientActions.SUBSYSTEM_DOWN, _event.Action); }