public void NonGenericDisablingTheEventShouldPreventItBeingExecuted() { using (EventContext.Disable(typeof(ITestEvent))) { EventContext.Publish <ITestEvent, TestEventArgs>(new TestEventArgs()); } TestEventImplementation.ExecutionCount.Should().Be(0); }
public void DisablingAnImplementationShouldOnlyDisableThatImplementation() { using (EventContext.Disable <TestEventImplementation>()) { EventContext.Publish <ITestEvent, TestEventArgs>(new TestEventArgs()); } TestEventImplementation.ExecutionCount.Should().Be(0); TestEventImplementation2.ExecutionCount.Should().Be(1); }