public void Object_Disposed_After_Creation_Returns_Null()
        {
            var disposable = new DisposableClass();
            var reg = new InstanceRegistration(typeof(DisposableClass), disposable, null);

            disposable = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();

            var instance = reg.Instance;
            instance.ShouldBeNull();
        }
        public void Instance_On_Creation_Is_Instance_Returned()
        {
            var disposable = new DisposableClass();
            var reg = new InstanceRegistration(typeof(DisposableClass), disposable, null);

            var instance1 = reg.CreateInstance(null);

            var instance2 = reg.Instance;

            var instance3 = reg.GetInstance(null);

            disposable.ShouldBeSameAs(instance1);
            disposable.ShouldBeSameAs(instance2);
            disposable.ShouldBeSameAs(instance3);
        }