本文整理匯總了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"));
}