📄 namefilter.cs
字号:
using System;
using System.Collections;
namespace NUnit.Core
{
/// <summary>
/// Summary description for NameFilter.
/// </summary>
///
[Serializable]
public class NameFilter : Filter
{
private ArrayList testNodes;
public NameFilter(Test node)
{
testNodes = new ArrayList();
testNodes.Add(node);
}
public NameFilter(ArrayList nodes)
{
testNodes = nodes;
}
public override bool Pass(TestSuite suite)
{
bool passed = Exclude;
foreach (Test node in testNodes)
{
if (suite.IsDescendant(node) || node.IsDescendant(suite) || node == suite)
{
passed = !Exclude;
break;
}
}
return passed;
}
public override bool Pass(TestCase test)
{
bool passed = Exclude;
foreach(Test node in testNodes)
{
if (test.IsDescendant(node) || test == node)
{
passed = !Exclude;
break;
}
}
return passed;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -