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(); }
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()); }
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; }
public Subscriber(string moduleName, ISafeEventRaiser eventRaiser, IAlarmManagementServiceCallback remoteSubscriber) : base(eventRaiser, remoteSubscriber) { _moduleName = moduleName; AlarmsChanged += remoteSubscriber.AlarmsChanged; }
protected WcfEventSubscriber(ISafeEventRaiser eventRaiser, TServiceCallback remoteSubscriber) { EventRaiser = eventRaiser; Callback = remoteSubscriber; }