当前位置: 首页>>代码示例>>C#>>正文


C# TestNode类代码示例

本文整理汇总了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 );
 }
开发者ID:taoxiease,项目名称:asegrp,代码行数:7,代码来源:TestNodeTests.cs

示例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);
 }
开发者ID:soxtoby,项目名称:EasyAssertions,代码行数:7,代码来源:TestNodeTests.cs

示例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;
            }
        }
开发者ID:mi-tettamanti,项目名称:nunit-gui,代码行数:31,代码来源:FixtureListDisplayStrategy.cs

示例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);
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:30,代码来源:AvlTreeTests.cs

示例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();
        }
开发者ID:sschocke,项目名称:BrainSimulator,代码行数:9,代码来源:NodeConnectionTests.cs

示例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);
        }
开发者ID:soxtoby,项目名称:EasyAssertions,代码行数:9,代码来源:TestNodeTests.cs

示例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);
        }
开发者ID:Green-Bug,项目名称:nunit-gui,代码行数:10,代码来源:ProgressBarPresenterTests.cs

示例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);
        }
开发者ID:soxtoby,项目名称:EasyAssertions,代码行数:10,代码来源:TestNodeTests.cs

示例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;
        }
开发者ID:Jedzia,项目名称:NStub,代码行数:22,代码来源:AssemblyFetcher.cs

示例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;
 }
开发者ID:nunit,项目名称:nunit-gui,代码行数:10,代码来源:XmlPresenter.cs

示例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);
        }
开发者ID:Green-Bug,项目名称:nunit-gui,代码行数:10,代码来源:CommandTests.cs

示例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));
        }
开发者ID:KGuetter,项目名称:nunit-gui,代码行数:10,代码来源:WhenTestRunCompletes.cs

示例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"));
        }
开发者ID:Jedzia,项目名称:NStub,代码行数:10,代码来源:TestNodeTest.cs

示例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));
        }
开发者ID:Green-Bug,项目名称:nunit-gui,代码行数:11,代码来源:WhenTestsAreReloaded.cs

示例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);
        }
开发者ID:tathamoddie,项目名称:RegexAnalyzer,代码行数:11,代码来源:AnalysisControllerTests.cs


注:本文中的TestNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。