public void Setup()
 {
     _testee            = new SafeEventRaiser();
     _loggerMock        = new Mock <ILogger>();
     _testMessageEvent += TestMessageEvent;
     _testMessageEventWithoutArguments += TestMessageEvent;
 }
        public void GivenLogger_MustLogUnsubscribe()
        {
            _testee            = new SafeEventRaiser(_loggerMock.Object);
            _testMessageEvent += BadSubscriptionMessageEvent;
            _loggerMock.
            Setup(logger => logger.Info(It.IsAny <string>()));

            _testee.Raise(ref _testMessageEvent, string.Empty);

            _loggerMock.VerifyAll();
        }
예제 #3
0
 public AlarmManagementService(
     IPlatformModuleRepository platformModuleRepository,
     ICallbackChannelProvider callbackChannelProvider,
     ISafeEventRaiser eventRaiser,
     ILogger logger)
 {
     _platformModuleRepository = platformModuleRepository;
     _callbackChannelProvider  = callbackChannelProvider;
     _eventRaiser = eventRaiser;
     _logger      = logger;
     _subscribers = new Collection <Subscriber>();
     _logger.Init(GetType());
 }
예제 #4
0
        public CommonServices(
            ILogger logger,
            IPlatformModuleRepository moduleRepository,
            IConfigurationService configurationService,
            ICallbackChannelProvider callbackChannelProvider,
            ISafeEventRaiser eventRaiser,
            IModuleBusManager moduleBusManager)
        {
            _logger                  = logger;
            _moduleRepository        = moduleRepository;
            _configurationService    = configurationService;
            _callbackChannelProvider = callbackChannelProvider;
            _eventRaiser             = eventRaiser;
            _moduleBusManager        = moduleBusManager;

            _moduleBusManager.ModuleInitializationStarted += HandleModuleInitializationStarted;
        }
예제 #5
0
 public Subscriber(string moduleName, ISafeEventRaiser eventRaiser, IAlarmManagementServiceCallback remoteSubscriber)
     : base(eventRaiser, remoteSubscriber)
 {
     _moduleName    = moduleName;
     AlarmsChanged += remoteSubscriber.AlarmsChanged;
 }
예제 #6
0
 protected WcfEventSubscriber(ISafeEventRaiser eventRaiser, TServiceCallback remoteSubscriber)
 {
     EventRaiser = eventRaiser;
     Callback    = remoteSubscriber;
 }