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