PathShouldBeExcluded() public method

public PathShouldBeExcluded ( string path ) : bool
path string
return bool
示例#1
0
        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"));
        }
示例#2
0
        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"));
        }