Пример #1
0
        public void ShouldNotResolveRejectedImplicitDependencies_WithWildcards()
        {
            var configs = new[]
            {
                DepTestHelper.CreateImplicitTestConfiguration("Alpha", Tuple.Create("master", "/sitecore/content")),
                DepTestHelper.CreateImplicitTestConfiguration("Beta", new [] { "A*" }, Tuple.Create("master", "/sitecore/content/Home"))
            };

            DepTestHelper.GroomConfigs(configs);

            var sut = configs[1].Resolve <ConfigurationDependencyResolver>();

            sut.Dependencies.Length.Should().Be(0);
        }
Пример #2
0
        public void ShouldResolveImplicitDependencies_WithSimilarPathRoots()
        {
            var configs = new[]
            {
                DepTestHelper.CreateImplicitTestConfiguration("A", Tuple.Create("master", "/sitecore/content")),
                DepTestHelper.CreateImplicitTestConfiguration("B", Tuple.Create("master", "/sitecore/contented/Home"))
            };

            DepTestHelper.GroomConfigs(configs);

            var sut = configs[1].Resolve <ConfigurationDependencyResolver>();

            sut.Dependencies.Should().BeEmpty();
        }
Пример #3
0
        public void IdenticalPaths_ShouldNotBeImplicitDependencies()
        {
            var configs = new[]
            {
                DepTestHelper.CreateImplicitTestConfiguration("A", Tuple.Create("master", "/sitecore/content")),
                DepTestHelper.CreateImplicitTestConfiguration("B", Tuple.Create("master", "/sitecore/content"))
            };

            DepTestHelper.GroomConfigs(configs);

            var sut = configs[1].Resolve <ConfigurationDependencyResolver>();

            sut.Dependencies.Should().BeEmpty();
        }
Пример #4
0
        public void ShouldResolveImplicitDependencies()
        {
            var configs = new[]
            {
                DepTestHelper.CreateImplicitTestConfiguration("A", Tuple.Create("master", "/sitecore/content")),
                DepTestHelper.CreateImplicitTestConfiguration("B", Tuple.Create("master", "/sitecore/content/Home"))
            };

            DepTestHelper.GroomConfigs(configs);

            var sut = configs[1].Resolve <ConfigurationDependencyResolver>();

            sut.Dependencies.Length.Should().Be(1);
            sut.Dependencies[0].Configuration.Name.Should().Be("A");
        }