本文整理汇总了C#中OpenCover.Framework.Filter.AddExcludedFolder方法的典型用法代码示例。如果您正苦于以下问题:C# Filter.AddExcludedFolder方法的具体用法?C# Filter.AddExcludedFolder怎么用?C# Filter.AddExcludedFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenCover.Framework.Filter
的用法示例。
在下文中一共展示了Filter.AddExcludedFolder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildFilter
/// <summary>
/// Create a filter entity from parser parameters
/// </summary>
/// <param name="parser"></param>
/// <returns></returns>
public static IFilter BuildFilter(CommandLineParser parser)
{
var filter = new Filter(parser.RegExFilters);
// apply filters
if (!parser.NoDefaultFilters)
{
if (parser.RegExFilters)
{
filter.AddFilter(@"-[(mscorlib)](.*)");
filter.AddFilter(@"-[(mscorlib\..*)](.*)");
filter.AddFilter(@"-[(System)](.*)");
filter.AddFilter(@"-[(System\..*)](.*)");
filter.AddFilter(@"-[(Microsoft.VisualBasic)](.*)");
}
else
{
filter.AddFilter("-[mscorlib]*");
filter.AddFilter("-[mscorlib.*]*");
filter.AddFilter("-[System]*");
filter.AddFilter("-[System.*]*");
filter.AddFilter("-[Microsoft.VisualBasic]*");
}
}
if (parser.Filters.Count > 0)
{
parser.Filters.ForEach(filter.AddFilter);
}
filter.AddAttributeExclusionFilters(parser.AttributeExclusionFilters.ToArray());
filter.AddFileExclusionFilters(parser.FileExclusionFilters.ToArray());
filter.AddTestFileFilters(parser.TestFilters.ToArray());
foreach (var excludeDir in parser.ExcludeDirs)
{
filter.AddExcludedFolder(excludeDir);
}
return filter;
}
示例2: ModulesInExcludedFoldersAreIdentifiedCorrectly
public void ModulesInExcludedFoldersAreIdentifiedCorrectly()
{
// arrange
var filter = new Filter(true);
filter.AddExcludedFolder("ABC");
// act
Assert.IsFalse(filter.UseModule(@"ABC\m.dll"));
Assert.IsTrue(filter.UseModule(@"DEF\m.dll"));
}