Ejemplo n.º 1
0
        public void InstanceResolveTest()
        {
            InvertContainer container = new InvertContainer();

            container.Register <MockDependency>();

            MockDependency dependency1 = container.Resolve <MockDependency>();
            MockDependency dependency2 = container.Resolve <MockDependency>();

            Assert.NotSame(dependency1, dependency2);
        }
Ejemplo n.º 2
0
        public void SingletonResolveTest()
        {
            InvertContainer container = new InvertContainer();

            container.Register <MockDependency>().Singleton();

            MockDependency dependency1 = container.Resolve <MockDependency>();
            MockDependency dependency2 = container.Resolve <MockDependency>();

            Assert.Same(dependency1, dependency2);
        }