BoDi.Tests.ObjectCreationTests.ShouldNotFireObjectCreatedEventOnSecondResolve C# (CSharp) Méthode

ShouldNotFireObjectCreatedEventOnSecondResolve() private méthode

private ShouldNotFireObjectCreatedEventOnSecondResolve ( ) : void
Résultat void
        public void ShouldNotFireObjectCreatedEventOnSecondResolve()
        {
            // given
            object objectCreated = null;
            container.ObjectCreated += o => objectCreated = o;

            // when
            var obj1 = container.Resolve<IInterface1>();
            objectCreated = null;
            var obj2 = container.Resolve<IInterface1>();

            // then

            Assert.IsNull(objectCreated);
        }