public void DisposeCallbackIsInvokedOnDispose()
        {
            IDisposable disposable = mocks.StrictMock<IDisposable>();
            disposable.Dispose();
            LastCall.On(disposable).Repeat.Once();            
			DummyFactoryObject factory = new DummyFactoryObject(disposable);
            mocks.ReplayAll();
            factory.AfterPropertiesSet();
            factory.Dispose();
            mocks.VerifyAll();
        }
        public void DisposeCallbackIsInvokedOnDispose()
        {
            IDisposable disposable = A.Fake <IDisposable>();

            DummyFactoryObject factory = new DummyFactoryObject(disposable);

            factory.AfterPropertiesSet();
            factory.Dispose();

            A.CallTo(() => disposable.Dispose()).MustHaveHappenedOnceExactly();
        }
        public void DisposeCallbackIsInvokedOnDispose()
        {
            IDisposable disposable = mocks.StrictMock <IDisposable>();

            disposable.Dispose();
            LastCall.On(disposable).Repeat.Once();
            DummyFactoryObject factory = new DummyFactoryObject(disposable);

            mocks.ReplayAll();
            factory.AfterPropertiesSet();
            factory.Dispose();
            mocks.VerifyAll();
        }