Esempio n. 1
0
        public void Should_clear_registered_events_for_garbage_collection()
        {
            int callCount = 0;

            postCommitEvent.PostCommit += () => { callCount++; };

            decorator.Handle(new object());

            postCommitEvent.Raise();
            Assert.AreEqual(1, callCount);
        }
 public void Handle(TCommand command)
 {
     try
     {
         decorated.Handle(command);
         postCommitEvent.Raise();
     }
     finally
     {
         postCommitEvent.Reset();
     }
 }