예제 #1
0
        public void HoldInstanceWithNull()
        {
            // Setup
            var lifespan = new DefaultLifespan();

            // Execute
            lifespan.Hold(a_instance: null);
        }
예제 #2
0
        public void HoldInstance()
        {
            // Setup
            var lifespan = new DefaultLifespan();
            var instance = new object();

            // Execute
            lifespan.Hold(instance);

            // Assert
            Assert.IsNull(lifespan.Instance);
        }
예제 #3
0
        public void KillInstanceWithNoInstanceHeld()
        {
            // Setup
            var lifespan = new DefaultLifespan();
            var instance = new object();
            lifespan.Hold(instance);

            // Execute
            lifespan.Kill();

            // Assert
            Assert.IsNull(lifespan.Instance);
        }