public void OnModule_ShouldNotNotifySubscriberOfDifferentModule()
        {
            IAlarmManagementService service = CreateService();

            service.SubscribeForAlarmChangesOnModule(LAB_1());
            _loadingStation1.RaiseAlarmsChangedEvent();
            _serviceCallback.ModuleWithLastAlarmsChange.Should().BeNull();
        }
        public void OnDifferentModuleAfterSubscribtion_ShouldNotifySubscriber()
        {
            IAlarmManagementService serivce = CreateService();

            serivce.SubscribeForAlarmChangesOnModule(LAB_1());
            _labelModule1.RaiseAlarmsChangedEvent();
            _serviceCallback.ModuleWithLastAlarmsChange.Should().Be(LAB_1());
        }
        public void Unsubscribe_WithNotExistingModule_ShouldThrowFaultException()
        {
            IAlarmManagementService service = CreateService();

            service.SubscribeForAlarmChangesOnModule(LOA_1());
            service.Invoking(s => s.UnsubscribeFromAlarmChangesFromModule("BLUB"))
            .ShouldThrow <FaultException <AlarmServiceFault> >();
        }
Ejemplo n.º 4
0
        public void GivenSubscriber_WhenAlarmsInLabelModuleChanged_ShouldNotifySubscribers()
        {
            IAlarmManagementService service = CreateService();

            service.SubscribeForAlarmChangesOnModule(LAB_1());
            _labelModule1.RaiseAlarmsChangedEvent();
            _serviceCallback.ModuleWithLastAlarmsChange.Should().Be(LAB_1());
        }
        public void OnModuleAfterUnsubscribtion_ShouldNotNotifyFormerSubscriber()
        {
            IAlarmManagementService service = CreateService();

            service.SubscribeForAlarmChangesOnModule(LAB_1());
            service.UnsubscribeFromAlarmChangesFromModule(LAB_1());
            _labelModule1.RaiseAlarmsChangedEvent();
            _serviceCallback.ModuleWithLastAlarmsChange.Should().BeNull();
        }
Ejemplo n.º 6
0
        public void GivenUnsubscriber_WhenAlarmsInLabelModuleChange_ShouldNotNotifyUnsubscriber()
        {
            IAlarmManagementService service = CreateService();

            service.SubscribeForAlarmChangesOnModule(LAB_1());
            service.UnsubscribeFromAlarmChangesFromModule(LAB_1());
            _labelModule1.RaiseAlarmsChangedEvent();
            _serviceCallback.ModuleWithLastAlarmsChange.Should().BeNullOrEmpty();
        }
        public void OnAnyModuleAfterUnsubscribtionOfEmptyStringSubscriber_ShouldNotNotifyFormerSubscriber()
        {
            IAlarmManagementService service = CreateService();

            service.SubscribeForAlarmChangesOnModule(string.Empty);
            service.UnsubscribeFromAlarmChangesFromModule(string.Empty);
            _labelModule1.RaiseAlarmsChangedEvent();
            _loadingStation1.RaiseAlarmsChangedEvent();
            _serviceCallback.ModuleWithLastAlarmsChange.Should().BeNull();
        }
        public void OnModulesAfterSubscribtionWithEmptyString_ShouldNotifySubscriberTwice()
        {
            IAlarmManagementService service = CreateService();

            service.SubscribeForAlarmChangesOnModule(string.Empty);
            _loadingStation1.RaiseAlarmsChangedEvent();
            _serviceCallback.ModuleWithLastAlarmsChange.Should().Be(string.Empty);
            _serviceCallback.Reset();
            _labelModule1.RaiseAlarmsChangedEvent();
            _serviceCallback.ModuleWithLastAlarmsChange.Should().Be(string.Empty);
        }