public void Unsubscribe_Not_Contains_Plugin_Test() { // 1) arrange var eventConteiner = MockRepository.GenerateMock <IEventContainer>(); IEventAggregatorService eventAggregator = new EventAggregatorService(errorHandler, publisherCreator, eventConteiner); // 2) act eventAggregator.UnsubscribePlugin(plugin); // 3) assert errorHandler.AssertWasNotCalled( x => x.OnUnsubscriptionFailed(plugin, new ExternalException()), option => option.IgnoreArguments()); }
public void Subscribe_Plugin_Test() { // 1) arrange var eventPublisher = new EventPublisher_Mock(); var publisherCreator = new PublisherCreator_Mock(eventPublisher); IEventAggregatorService eventAggregator = new EventAggregatorService(errorHandler, publisherCreator, eventConteiner); // 2) act eventAggregator.SubscribePlugin(plugin); // 3) assert errorHandler.AssertWasNotCalled( x => x.OnSubscriptionFailed(plugin, new ExternalException()), option => option.IgnoreArguments()); }