本文整理汇总了C#中TestNode类的典型用法代码示例。如果您正苦于以下问题:C# TestNode类的具体用法?C# TestNode怎么用?C# TestNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestNode类属于命名空间,在下文中一共展示了TestNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConstructFromSuite
public void ConstructFromSuite()
{
TestNode test = new TestNode( testSuite );
Assert.IsNotNull( test.Tests );
Assert.AreEqual( test.TestCount, CountTests( test ) );
Assert.AreSame( test, ((TestNode)test.Tests[0]).Parent );
}
示例2: Add_AddsAChild
public void Add_AddsAChild()
{
TestNode<int> sut = new TestNode<int>();
TestNode<int> child = new TestNode<int>(1);
sut.Add(child);
CollectionAssert.AreEqual(new[] { child }, sut);
}
示例3: 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;
}
}
示例4: TestAddCase2
public void TestAddCase2()
{
var tree = new AvlTree<TestNode> ();
var t3 = new TestNode (3);
var t24 = new TestNode (24);
var t26 = new TestNode (26);
tree.Add (t3);
Assert.AreEqual (1, tree.Count);
tree.Remove (t3);
tree.Add (new TestNode (37));
tree.Add (new TestNode (70));
tree.Add (new TestNode (12));
Assert.AreEqual (3, tree.Count);
tree.Add (new TestNode (90));
tree.Add (new TestNode (25));
tree.Add (new TestNode (99));
tree.Add (new TestNode (91));
tree.Add (t24);
tree.Add (new TestNode (28));
tree.Add (t26);
// Should do a single left rotation on node with key 12
tree.Remove (t24);
Assert.IsTrue (tree.Root.Left == t26, "was:" + tree.Root.Left);
}
示例5: NodeConnectionTests
// TODO(HonzaS): test the special subclasses of MyNode (Input/Output nodes etc.)
public NodeConnectionTests()
{
m_node1 = new TestNode();
m_node2 = new TestNode();
m_connection = new MyConnection(m_node1, m_node2, 0, 0);
m_connection.Connect();
}
示例6: NodeExtensions_AddsChildren
public void NodeExtensions_AddsChildren()
{
TestNode<int> child1 = new TestNode<int>(1);
TestNode<int> child2 = new TestNode<int>(2);
TestNode<int> result = 1.Node(child1, child2);
CollectionAssert.AreEqual(new[] { child1, child2 }, result);
}
示例7: WhenTestsAreReloaded_ProgressBar_IsInitialized
public void WhenTestsAreReloaded_ProgressBar_IsInitialized()
{
_model.HasTests.Returns(true);
_model.IsTestRunning.Returns(false);
var testNode = new TestNode("<test-suite id='1' testcasecount='1234'/>");
_model.TestReloaded += Raise.Event<TestNodeEventHandler>(new TestNodeEventArgs(TestAction.TestReloaded, testNode));
_view.Received().Initialize(100);
}
示例8: AddRange_AddsChildren
public void AddRange_AddsChildren()
{
TestNode<int> sut = new TestNode<int>();
TestNode<int> child1 = new TestNode<int>(1);
TestNode<int> child2 = new TestNode<int>(2);
sut.AddRange(new[] { child1, child2 });
CollectionAssert.AreEqual(new[] { child1, child2 }, sut);
}
示例9: AssemblyFetcher
private readonly List<AssemblyName> _referencedAssemblies; // = new List<AssemblyName>();
#endregion Fields
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="T:AssemblyFetcher"/> class.
/// </summary>
/// <param name="methodVisibility">The method visibility to parse.</param>
/// <param name="assemblyName">Description text of the root assembly node.</param>
/// <param name="inputAssemblies">The list of input assemblies.</param>
public AssemblyFetcher(MemberVisibility methodVisibility, string assemblyName, IEnumerable<string> inputAssemblies)
{
Guard.NotNullOrEmpty(() => assemblyName, assemblyName);
Guard.NotNull(() => inputAssemblies, inputAssemblies);
_assemblyGraphTreeView = new TestNode() { Text = assemblyName };
_inputAssemblyOpenFileDialog = inputAssemblies.ToList();
_referencedAssemblies = new List<AssemblyName>();
this.methodVisibility = methodVisibility;
}
示例10: FindXmlNode
private static XmlNode FindXmlNode(XmlNode currentXml, TestNode testNodeChild)
{
foreach (XmlNode child in currentXml.ChildNodes)
{
if ((child.LocalName == "test-case" || child.LocalName == "test-suite")
&& testNodeChild.FullName == child.Attributes["fullname"].Value)
return child;
}
return null;
}
示例11: ToolStrip_RunSelectedCommand_RunsSelectedTest
public void ToolStrip_RunSelectedCommand_RunsSelectedTest()
{
var testNode = new TestNode("<test-case id='123'/>");
var treeNode = new TreeNode("test");
treeNode.Tag = testNode;
_view.Tree.SelectedNodeChanged += Raise.Event<TreeNodeActionHandler>(treeNode);
_view.RunSelectedCommand.Execute += Raise.Event<CommandHandler>();
_model.Received().RunTests(testNode);
}
示例12: SimulateTestRunFinish
public void SimulateTestRunFinish()
{
Model.HasTests.Returns(true);
Model.IsTestRunning.Returns(false);
XmlDocument doc = new XmlDocument();
doc.LoadXml("<test-suite/>");
TestNode resultNode = new TestNode(doc.FirstChild);
Model.RunFinished += Raise.Event<TestEventHandler>(new TestEventArgs(TestAction.RunFinished, resultNode));
}
示例13: ConstructWithParametersTextTestNodeTypeTagValueTest
public void ConstructWithParametersTextTestNodeTypeTagValueTest()
{
this.text = "Value of text";
this.testObjectClr = new TestNode(this.text, this.testNodeType, this.tagValueClrType);
Assert.Throws<ArgumentNullException>(() => new TestNode(null, this.testNodeType, this.tagValueClrType));
Assert.Throws<ArgumentException>(() => new TestNode(string.Empty, this.testNodeType, this.tagValueClrType));
//Assert.Throws<ArgumentOutOfRangeException>(() => new TestNode(this.text, this.testNodeType, null));
//Assert.Throws<ArgumentOutOfRangeException>(() => new TestNode(this.text, this.testNodeType, "other Type"));
}
示例14: SimulateTestLoad
public void SimulateTestLoad()
{
Model.HasTests.Returns(true);
Model.IsTestRunning.Returns(false);
XmlDocument doc = new XmlDocument();
doc.LoadXml("<test-suite id='1'/>");
TestNode testNode = new TestNode(doc.FirstChild);
Model.Tests.Returns(testNode);
Model.TestLoaded += Raise.Event<TestNodeEventHandler>(new TestNodeEventArgs(TestAction.TestLoaded, testNode));
}
示例15: AnalysisController_BuildNodeClass_ShouldReturnDefaultClassesWithNodeId
public void AnalysisController_BuildNodeClass_ShouldReturnDefaultClassesWithNodeId()
{
// Arrange
var node = new TestNode("abc", 0) { NodeId = 456 };
// Act
var nodeClass = AnalysisController.BuildNodeClass(node);
// Assert
Assert.AreEqual("ast-node ast-node-456", nodeClass);
}