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 void SubscribeModuleStateEvents() { Initialize(); try { _logger.DebugFormat("Remote subscriber subscribes ModuleState event on '{0}'.", this); var subscriber = _callbackChannelProvider.GetCallbackChannel <ICommonServicesEvents>(); _platformModuleStateChanged += subscriber.PlatformModuleStateChanged; } catch (Exception e) { _logger.Error(e.Message, e); throw new FaultException <CommonServicesFault>(new CommonServicesFault(), e.Message); } foreach (var platformModule in _moduleRepository.Modules) { _eventRaiser.Raise(ref _platformModuleStateChanged, ((PlatformModule)platformModule).ToDTO()); } }
public void TestRaiseEvent() { _testee.Raise(ref _testMessageEvent, "test"); _receivedMessage.Should().Be("test"); }