示例#1
0
        public void UsingScope_Test_With_Constructor_ShouldWork()
        {
            LocalIocManager.Register <SimpleDisposableObject>(DependencyLifeStyle.Transient);

            SimpleDisposableObject simpleObj = null;

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

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

            SimpleDisposableObject simpleObj = null;

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

            simpleObj.DisposeCount.ShouldBe(1);
        }