Esempio n. 1
0
        public void WithActivationFunction_SameObjectsAreReturned()
        {
            var lifecycle = new LightCore.Lifecycle.SingletonLifecycle();
            var factory   = GetActivationFactory();

            var instanceOne = lifecycle.ReceiveInstanceInLifecycle(factory);
            var instanceTwo = lifecycle.ReceiveInstanceInLifecycle(factory);

            instanceOne.Should().Be(instanceTwo);
        }
        public void WithActivationFunction_SameObjectsAreReturned()
        {
            var lifecycle = new LightCore.Lifecycle.SingletonLifecycle();
            var factory = this.GetActivationFactory();

            object instanceOne = lifecycle.ReceiveInstanceInLifecycle(factory);
            object instanceTwo = lifecycle.ReceiveInstanceInLifecycle(factory);

            Assert.That(instanceOne, Is.SameAs(instanceTwo));
        }