public void ExcludedFunctionIsExcluded()
{
string config = "<ccm>" +
" <exclude>" +
" <function>Foo2</function> " +
" <function>Bar2</function> " +
" </exclude>" +
"</ccm>";
XmlDocument doc = new XmlDocument();
doc.LoadXml(config);
ConfigurationFile file = new ConfigurationFile(doc);
string code1 = "void Foo() {}";
string code2 = "void Bar() {}";
string code3 = "void Foo2() {}";
string code4 = "void Bar2() {}";
Driver driver = new Driver(file);
driver.StartAnalyze(TestUtil.GetTextStream(code1), "file1.h");
driver.StartAnalyze(TestUtil.GetTextStream(code2), "file2.h");
driver.StartAnalyze(TestUtil.GetTextStream(code3), "file3.h");
driver.StartAnalyze(TestUtil.GetTextStream(code4), "file4.h");
driver.WaitForWorkThreadsToFinish();
DriverTests.AssertMetric(driver.Metrics, "Foo()", 1, "file1.h");
DriverTests.AssertMetric(driver.Metrics, "Bar()", 1, "file2.h");
Assert.AreEqual(2, driver.Metrics.Count);
}