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

ShouldNotFireObjectCreatedEventOnResolvingFactoryRegistrations() private method

        public void ShouldNotFireObjectCreatedEventOnResolvingFactoryRegistrations()
        {
            // given
            container.RegisterFactoryAs<IInterface1>(() => new ConstructorTrackingClass());

            object objectCreated = null;
            container.ObjectCreated += o => objectCreated = o;

            // when
            container.Resolve<IInterface1>();

            // then
            Assert.IsNull(objectCreated);
        }