• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TestNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TestNode的典型用法代码示例。如果您正苦于以下问题:C# TestNode类的具体用法?C# TestNode怎么用?C# TestNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TestNode类属于命名空间,在下文中一共展示了TestNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: GetTestType

 public static string GetTestType(TestNode testNode)
 {
     if (testNode.RunState == RunState.NotRunnable && testNode.Type == "Assembly")
     {
         var fi = new FileInfo(testNode.FullName);
         string extension = fi.Extension.ToLower();
         if (extension != ".exe" && extension != ".dll")
           return "Unknown";
     }
     return testNode.Type;
 }
开发者ID:nunit,项目名称:nunit-gui,代码行数:11,代码来源:TestPropertiesPresenter.cs


示例17: CountTests

        private int CountTests( TestNode node )
        {
            if ( !node.IsSuite )
                return 1;

            int count = 0;
            if ( node.Tests != null )
                foreach( TestNode child in node.Tests )
                    count += CountTests( child );

            return count;
        }
开发者ID:taoxiease,项目名称:asegrp,代码行数:12,代码来源:TestNodeTests.cs


示例18: TestRemoveBug

		public void TestRemoveBug ()
		{
			var tree = new RedBlackTree<TestNode> ();
			TestNode t1 = new TestNode (1);
			TestNode t2 = new TestNode (2);
			TestNode t3 = new TestNode (3);
			
			tree.Add (t1);
			tree.InsertRight (t1, t2);
			tree.InsertLeft (t1, t3);
			tree.Remove (t1);
			Assert.AreEqual (2, tree.Count);
		} 
开发者ID:Kalnor,项目名称:monodevelop,代码行数:13,代码来源:RedBlackTreeTests.cs


示例19: OnTestLoaded

        public override void OnTestLoaded(TestNode testNode)
        {
            ClearTree();

            foreach (var topLevelNode in testNode.Children)
            {
                var treeNode = MakeTreeNode(topLevelNode, true);

                _view.Tree.Add(treeNode);

                SetInitialExpansion(treeNode);
            }
        }
开发者ID:mi-tettamanti,项目名称:nunit-gui,代码行数:13,代码来源:NUnitTreeDisplayStrategy.cs


示例20: AnalysisController_RenderExpressionAsHtml_ShouldRenderContentBeforeAllNodes

        public void AnalysisController_RenderExpressionAsHtml_ShouldRenderContentBeforeAllNodes()
        {
            // Arrange
            var nodes = new TestNode("abcdef", 0, new Node[]
            {
                new TestNode("def", 3) { NodeId = 1 }
            });

            // Act
            var result = AnalysisController.RenderExpressionAsHtml(nodes).ToHtmlString();

            // Assert
            Assert.AreEqual("abc<span class=\"ast-node ast-node-1\" title=\"3\">def</span>", result);
        }
开发者ID:tathamoddie,项目名称:RegexAnalyzer,代码行数:14,代码来源:AnalysisControllerTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TestODataMetadataLevel类代码示例发布时间:2022-05-24
下一篇:
C# TestModelMetadataProvider类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap