public void when_and_afterHandlers_with_no_arguments_are_called()
        {
            int    callCount = 0;
            Action handler   = delegate() {
                callCount++;
            };

            lifecycle
            .WhenInitializing(handler).AfterInitializing(handler)
            .WhenSuspending(handler).AfterSuspending(handler)
            .WhenResuming(handler).AfterResuming(handler)
            .WhenDestroying(handler).AfterDestroying(handler);
            lifecycle.Initialize();
            lifecycle.Suspend();
            lifecycle.Resume();
            lifecycle.Destroy();
            Assert.That(callCount, Is.EqualTo(8));
        }
 public IContext WhenInitializing(Action handler)
 {
     _lifecycle.WhenInitializing(handler);
     return(this);
 }