本文整理汇总了C#中TestNode.Select方法的典型用法代码示例。如果您正苦于以下问题:C# TestNode.Select方法的具体用法?C# TestNode.Select怎么用?C# TestNode.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestNode
的用法示例。
在下文中一共展示了TestNode.Select方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTestLoaded
public override void OnTestLoaded(TestNode testNode)
{
ClearTree();
switch (DefaultGroupSetting)
{
default:
case "ASSEMBLY":
foreach (TestNode assembly in testNode
.Select((node) => node.IsSuite && node.Type == "Assembly"))
{
TreeNode treeNode = MakeTreeNode(assembly, false);
foreach (TestNode fixture in GetTestFixtures(assembly))
treeNode.Nodes.Add(MakeTreeNode(fixture, true));
_view.Tree.Add(treeNode);
CollapseToFixtures(treeNode);
}
break;
case "CATEGORY":
case "OUTCOME":
case "DURATION":
_grouping.Load(GetTestFixtures(testNode));
UpdateDisplay();
break;
}
}
示例2: Load
protected override void Load(TestNode testNode)
{
ClearTree();
switch (_groupBy)
{
default:
case "ASSEMBLY":
foreach (TestNode assembly in testNode
.Select((node) => node.IsSuite && node.Type == "Assembly"))
{
TreeNode treeNode = MakeTreeNode(assembly, false);
foreach (TestNode test in GetTestCases(assembly))
treeNode.Nodes.Add(MakeTreeNode(test, true));
_view.Tree.Add(treeNode);
treeNode.ExpandAll();
}
break;
case "FIXTURE":
foreach (TestNode fixture in testNode
.Select((node) => node.IsSuite && node.Type == "TestFixture"))
{
TreeNode treeNode = MakeTreeNode(fixture, false);
foreach (TestNode test in GetTestCases(fixture))
treeNode.Nodes.Add(MakeTreeNode(test, true));
_view.Tree.Add(treeNode);
treeNode.ExpandAll();
}
break;
case "CATEGORY":
case "OUTCOME":
case "DURATION":
_grouping.Load(GetTestCases(testNode));
UpdateDisplay();
break;
}
}
示例3: GetTestFixtures
private TestSelection GetTestFixtures(TestNode testNode)
{
return testNode
.Select((node) => node.Type == "TestFixture")
.SortBy((x, y) => x.Name.CompareTo(y.Name));
}
示例4: GetTestCases
private TestSelection GetTestCases(TestNode testNode)
{
return testNode
.Select((n) => !n.IsSuite)
.SortBy((x, y) => x.Name.CompareTo(y.Name));
}