public void ExcludedFolderOnlyExcludesWhereNameOfFolderIsExactMatch() { string config = "<ccm>" + " <exclude>" + " <folder>Foo</folder> " + " <folder>Bar</folder> " + " </exclude>" + "</ccm>"; XmlDocument doc = new XmlDocument(); doc.LoadXml(config); ConfigurationFile file = new ConfigurationFile(doc); Driver driver = new Driver(file); Assert.IsTrue(driver.PathShouldBeExcluded("c:\\code\\Foo\\file.cpp")); Assert.IsTrue(driver.PathShouldBeExcluded("c:\\code\\bar\\file.cpp")); Assert.IsFalse(driver.PathShouldBeExcluded("c:\\code\\FooBar\\fileB.cs")); Assert.IsFalse(driver.PathShouldBeExcluded("c:\\code\\BarA\\fileB.cs")); }
public void FullFolderPathIsExcludedOnExactMatch() { string config = "<ccm>" + " <exclude>" + " <folder>c:\\code</folder> " + " </exclude>" + "</ccm>"; XmlDocument doc = new XmlDocument(); doc.LoadXml(config); ConfigurationFile file = new ConfigurationFile(doc); Driver driver = new Driver(file); Assert.IsTrue(driver.PathShouldBeExcluded("c:\\code\\file.cpp")); Assert.IsTrue(driver.PathShouldBeExcluded("c:\\code\\sub\\file.cpp")); Assert.IsFalse(driver.PathShouldBeExcluded("c:\\temp\\fileB.cs")); }