BoDi.Tests.ObjectCreationTests.ShouldNotFireObjectCreatedEventOnSecondResolve C# (CSharp) Method

ShouldNotFireObjectCreatedEventOnSecondResolve() private method

private ShouldNotFireObjectCreatedEventOnSecondResolve ( ) : void
return 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);
        }