public void object_is_not_disposed_in_nested_container()
        {
            var guy = new DisposableGuy();

            var container = new Container(x => { x.For <DisposableGuy>().Use(guy); });

            using (var nested = container.GetNestedContainer())
            {
            }

            guy.WasDisposed.ShouldBeFalse();

            container.Dispose();

            guy.WasDisposed.ShouldBeTrue();
        }
Ejemplo n.º 2
0
        public void object_is_not_disposed_in_nested_container()
        {
            var guy = new DisposableGuy();

            var container = new Container(x => { x.For<DisposableGuy>().Use(guy); });

            using (var nested = container.GetNestedContainer())
            {
            }

            guy.WasDisposed.ShouldBeFalse();

            container.Dispose();

            guy.WasDisposed.ShouldBeTrue();
        }