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")); }
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); }
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()); }
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); }