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

            lifecycle
            .BeforeInitializing(handler)
            .BeforeSuspending(handler)
            .BeforeResuming(handler)
            .BeforeDestroying(handler);
            lifecycle.Initialize();
            lifecycle.Suspend();
            lifecycle.Resume();
            lifecycle.Destroy();
            Assert.That(callCount, Is.EqualTo(4));
        }
 public IContext BeforeInitializing(Action handler)
 {
     _lifecycle.BeforeInitializing(handler);
     return(this);
 }