Esempio n. 1
0
 public void NonGenericDisablingTheEventShouldPreventItBeingExecuted()
 {
     using (EventContext.Disable(typeof(ITestEvent)))
     {
         EventContext.Publish <ITestEvent, TestEventArgs>(new TestEventArgs());
     }
     TestEventImplementation.ExecutionCount.Should().Be(0);
 }
Esempio 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);
 }