Example #1
0
        public void UsingScopeTestWithConstructorShouldWork()
        {
            LocalIocManager.Register <SimpleDisposableObject>(DependencyLifeStyle.Transient);

            SimpleDisposableObject simpleObj = null;

            LocalIocManager.UsingScope(scope => { simpleObj = scope.Resolve <SimpleDisposableObject>(new { myData = 40 }); });

            simpleObj.MyData.ShouldBe(40);
        }
Example #2
0
        public void UsingScopeTestShouldWork()
        {
            LocalIocManager.Register <SimpleDisposableObject>(DependencyLifeStyle.Transient);

            SimpleDisposableObject simpleObj = null;

            LocalIocManager.UsingScope(scope => { simpleObj = scope.Resolve <SimpleDisposableObject>(); });

            simpleObj.DisposeCount.ShouldBe(1);
        }