コード例 #1
0
        public void BeginScopeRelease_WithRegisterdObject_ShouldBeAssignableToIDoSomething(Locator.Interface.IScopedServiceLocator sut)
        {
            using (sut.BeginScope())
            {
                var instance1 = sut.Resolve<IDoSomething>();

                var instance2 = sut.Resolve<IDoSomething>();

                instance1.ShouldBeAssignableTo(typeof(IDoSomething));

                instance2.ShouldBeAssignableTo(typeof(IDoSomething));

                instance1.ShouldBeSameAs(instance2);

                sut.Release(instance1);
            }
        }