예제 #1
0
        public void DoesNotReturnIncorrectExcludedItemsTest()
        {
            var path       = Environment.CurrentDirectory;
            var xmlPath    = string.Concat(path.Substring(0, path.IndexOf("bin")), "sample.xml");
            var exclusions = ExclusionHandler.GetExcludedItems(xmlPath, "Test");

            Assert.False(exclusions.Contains("sitecore\\content\\mysite\\donotexcludefrombuild1.item"));
        }
예제 #2
0
        public void HasCorrectNumberOfExcludedItemsTest()
        {
            var expected   = 3;
            var path       = Environment.CurrentDirectory;
            var xmlPath    = string.Concat(path.Substring(0, path.IndexOf("bin")), "sample.xml");
            var exclusions = ExclusionHandler.GetExcludedItems(xmlPath, "Test");

            Assert.AreEqual(expected, exclusions.Count);
        }
예제 #3
0
        public void DoesNotReturnForConfigurationWithoutExclusionsTest()
        {
            var path          = Environment.CurrentDirectory;
            var xmlPath       = string.Concat(path.Substring(0, path.IndexOf("bin")), "sample.xml");
            var configuration = "NO_RESULTS_CONFIGURATION";

            var actual = ExclusionHandler.HasValidExclusions(configuration, xmlPath);

            Assert.True(actual);
            var exclusions = ExclusionHandler.GetExcludedItems(xmlPath, configuration);

            Assert.False(exclusions.Any());
        }
예제 #4
0
        public void ReturnsCorrectExcludedItemsTest()
        {
            var expected = new string[]
            {
                "sitecore\\content\\mysite\\excludefrombuild1.item",
                "sitecore\\content\\mysite\\excludefrombuild2.item",
                "sitecore\\content\\mysite\\excludefrombuild3.item"
            };

            var path       = Environment.CurrentDirectory;
            var xmlPath    = string.Concat(path.Substring(0, path.IndexOf("bin")), "sample.xml");
            var exclusions = ExclusionHandler.GetExcludedItems(xmlPath, "Test");

            Assert.AreEqual(expected, exclusions);
        }