Beispiel #1
0
            public void SwitchInRootResolver_leaves_other_resolvers_intact()
            {
                var configuration = new DbConfiguration().InternalConfiguration;
                var mockResolver  = new Mock <IDbDependencyResolver>();

                configuration.AddDependencyResolver(mockResolver.Object);

                configuration.SwitchInRootResolver(new Mock <RootDependencyResolver>().Object);

                configuration.DependencyResolver.GetService <object>("Foo");
                mockResolver.Verify(m => m.GetService(typeof(object), "Foo"));
            }
Beispiel #2
0
            public void SwitchInRootResolver_swicthes_in_given_root_resolver()
            {
                var configuration    = new DbConfiguration().InternalConfiguration;
                var mockRootResolver = new Mock <RootDependencyResolver>();

                configuration.SwitchInRootResolver(mockRootResolver.Object);

                Assert.Same(mockRootResolver.Object, configuration.RootResolver);

                configuration.DependencyResolver.GetService <object>("Foo");
                mockRootResolver.Verify(m => m.GetService(typeof(object), "Foo"));
            }
            public void SwitchInRootResolver_leaves_other_resolvers_intact()
            {
                var configuration = new DbConfiguration();
                var mockResolver = new Mock<IDbDependencyResolver>();
                configuration.AddDependencyResolver(mockResolver.Object);

                configuration.SwitchInRootResolver(new Mock<RootDependencyResolver>().Object);

                configuration.DependencyResolver.GetService<object>("Foo");
                mockResolver.Verify(m => m.GetService(typeof(object), "Foo"));
            }
            public void SwitchInRootResolver_swicthes_in_given_root_resolver()
            {
                var configuration = new DbConfiguration();
                var mockRootResolver = new Mock<RootDependencyResolver>();
                configuration.SwitchInRootResolver(mockRootResolver.Object);

                Assert.Same(mockRootResolver.Object, configuration.RootResolver);

                configuration.DependencyResolver.GetService<object>("Foo");
                mockRootResolver.Verify(m => m.GetService(typeof(object), "Foo"));
            }