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

C# nist_dom.testResults类代码示例

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

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



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

示例1: core0001M

	public void core0001M()
        {
            string computedValue = "";
            string expectedValue = "domestic";
            System.Xml.XmlAttribute domesticAttr = null;
            System.Xml.XmlNode testNode = null;

            testResults results = new testResults("Core0001M");
            try
            {
                results.description = "The \"getNamedItem(name)\" method retrieves a node " +
                    "specified by name.";
                //
                // Retrieve targeted data.
                //
                testNode = util.nodeObject(util.SECOND,util.SIXTH);
                domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");
                computedValue = domesticAttr.Name;
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }

            //
            // Write out results 
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:carrie901,项目名称:mono,代码行数:32,代码来源:NamedNodeMap.cs


示例2: core0001C

		public void core0001C()
		{
			string computedValue = "";
			string expectedValue = "Margaret Martin";
			System.Xml.XmlNode testNode = null;
			System.Xml.XmlCharacterData testNodeData = null;

			testResults results = new testResults("Core0001C");
			try
			{
				results.description = "The \"data\" attribute is the character data that " +
					"implements this interface.";
				//
				// Access the targeted data.
				//
				testNode = util.nodeObject(util.FIRST,util.SECOND);
				testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild; 
				computedValue = testNodeData.Data;
			}
			catch(System.Exception ex)
			{
				computedValue = "Exception " + ex.Message;
			}
			//
			// Write out results 
			//
			results.expected = expectedValue;
			results.actual = computedValue;

			AssertEquals (results.expected, results.actual);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:31,代码来源:CharacterData.cs


示例3: core0001N

	public void core0001N()
        {
            string computedValue = "";
            string expectedValue = "employeeId";
            System.Xml.XmlNode employeeId = null;
            System.Xml.XmlElement testNode = null;

            testResults results = new testResults("Core0001N");
            try
            {
                results.description = "The elements in the list are accessible via an "+
                    "integral index starting from 0 (this test checks "+
                    "for index equal to 0).";
                //
                // Retrieve targeted data.
                //
                testNode = (System.Xml.XmlElement)util.nodeObject(util.THIRD,-1); 
                employeeId = util.getSubNodes(testNode).Item(util.FIRST); 
                computedValue = employeeId.Name;
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }

            //
            // Write out results 
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:33,代码来源:NodeList.cs


示例4: core0001D

	public void core0001D()
        {
            string computedValue = "";
            string expectedValue = "staff";
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0001D");

            results.description = "The doctype attribute contains the Document Type "+
                "Declaration associated with this object.";  
            //
            // Retrieve the targeted data and access its "doctype" attribute.
            //
            testNode = util.getDOMDocument(); 
            System.Xml.XmlDocumentType dtype = testNode.DocumentType;
            computedValue = dtype.Name;

            //
            // Write out results. 
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:nobled,项目名称:mono,代码行数:25,代码来源:Document.cs


示例5: core0001A

        public void core0001A()
        {
            object computedValue = null;
            object expectedValue = null; 
            System.Xml.XmlNode testNode = null;
            System.Xml.XmlAttribute domesticAttr = null;

            testResults results = new testResults("Core0001A");

            try
            {
                results.description = "The ParentNode attribute should be null for" +
                    " an Attr object.";
                //
                //   Retrieve targeted data and examine parentNode attribute.
                //
                testNode = util.nodeObject(util.FIRST, util.SIXTH);
                domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");
                computedValue = domesticAttr.ParentNode;
                //
                //    Write out results 
                //
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }

            results.expected = (expectedValue == null).ToString();
            results.actual = (computedValue == null).ToString();
	    Assert.AreEqual (results.expected, results.actual);
            // return results;

        }
开发者ID:Profit0004,项目名称:mono,代码行数:34,代码来源:Attr.cs


示例6: core0001NO

	public void core0001NO()
        {
            int computedValue = 0;
            int expectedValue = util.ELEMENT_NODE;

            testResults results = new testResults("Core0001NO");

            results.description = "The nodeType attribute for an Element Node "+
                " should be set to the constant 1.";
            //
            // The nodeType attribute for the root node should be set to the value 1.
            //
            computedValue = (int)util.getRootNode().NodeType;
            //
            // write out results.
            //
            results.expected = expectedValue.ToString();
            results.actual = computedValue.ToString();
            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:whereisaaron,项目名称:mono,代码行数:20,代码来源:Node.cs


示例7: core0001E

	public void core0001E()
        {
            string computedValue = "0";//0
            string expectedValue = "True";//true
            System.Xml.XmlNode addressElement = null;
            System.Xml.XmlAttributeCollection attrList = null;
            System.Xml.XmlAttribute domesticAttr = null;

            testResults results = new testResults("Core0001E");
            try
            {
                results.description = "Element nodes may have associated attributes.";
                //
                // Retrieve the "address" element from the first employee.
                //
                addressElement = util.nodeObject(util.FIRST,util.SIXTH);
                //
                // Access its "domestic" attribute by creating a list of all attributes
                // and then retrieving the desired attribute from the list by name. 
                //
                attrList = addressElement.Attributes;//.node.
                domesticAttr = (System.Xml.XmlAttribute)attrList.GetNamedItem("domestic");
                //
                // Access its "specified" attribute.
                //
                computedValue = domesticAttr.Specified.ToString();
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }

            //
            // Write out results 
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:40,代码来源:Element.cs


示例8: core0001CO

        public void core0001CO()
        {
            string computedValue = "";
            string expectedValue = " This is comment number 1.";
            System.Xml.XmlNode testNode = null;

            testResults results = new testResults("Core0001CO");

            results.description = "A comment is all the characters between the " + "start comment and end comment strings.";
            //
            // Retrieve the targeted data and access its nodeValue.
            //
            testNode = util.getDOMDocument().ChildNodes.Item(2); 
            computedValue = testNode.Value;//nodeValue;
            //
            // Write out results 
            //

            results.expected = expectedValue;
            results.actual = computedValue;

            AssertEquals (results.expected, results.actual);
        }
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:23,代码来源:Comment.cs


示例9: core0001T

	public void core0001T()
        {
            string computedValue = "";
            string expectedValue = "Roger\n Jones";
            System.Xml.XmlNode testNode = null;
            System.Xml.XmlCharacterData testNodeData = null;

            testResults results = new testResults("Core0001T");
            try
            {
                results.description = "If there is no markup language in a block of text, " +
                    "then the content of the text is contained into " +
                    "an object implementing the Text interface that is " +
                    "the only child of the element."; 
                //
                // Retrieve the second child of the second employee and access its
                // textual data. 
                //
                testNode = util.nodeObject(util.THIRD,util.SECOND); 
                testNode.Normalize();
                testNodeData = (System.Xml.XmlCharacterData)testNode.FirstChild;
                computedValue = testNodeData.Value;
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }

            //
            // Write out results 
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:nobled,项目名称:mono,代码行数:36,代码来源:Text.cs


示例10: core0001DI

	public void core0001DI()
        {
            bool computedValue = false;
            bool expectedValue = true;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0001DI");

            results.description = "Check for feature = XML in the \"hasFeature(feature,version)\" method."; 
            //
            // Retrieve the targeted data and invoke its "hasFeature(feature,version)".
            // method.
            //
            testNode = util.getDOMDocument();
            computedValue = testNode.Implementation.HasFeature("XML","1.0");
            //
            // Write out results.
            //

            results.expected = expectedValue.ToString();
            results.actual = computedValue.ToString();

            AssertEquals (results.expected, results.actual);
        }
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:24,代码来源:DOMImplementation.cs


示例11: core0007T

	public void core0007T()
        {
            string computedValue = "";
            System.Xml.XmlText oldTextNode = null;
            System.Xml.XmlText newTextNode = null;
            System.Xml.XmlNode testNode = null;
            string expectedValue = "System.ArgumentOutOfRangeException";//util.INDEX_SIZE_ERR;

            testResults results = new testResults("Core0007T");
            try
            {
                results.description = "The \"splitText(offset)\" method raises an " +
                    "INDEX_SIZE_ERR Exception if the specified " +
                    "offset is negative.";

                //
                // Retrieve the targeted data
                //
                testNode = util.nodeObject(util.THIRD,util.SECOND);
                oldTextNode = (System.Xml.XmlText)testNode.FirstChild;
                //
                // Call the "spitText(offset)" method with "offset" equal to a negative 
                // number should raise an exception.
                //
                try 
                {
                    oldTextNode.SplitText(-69);
                }
                catch(System.Exception ex) 
                {
                    computedValue = ex.GetType ().FullName; 
                }
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }

            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:nobled,项目名称:mono,代码行数:45,代码来源:Text.cs


示例12: core0005T

	public void core0005T()
        {
            string computedValue = "";
            string expectedValue = " Jones";
            System.Xml.XmlText oldTextNode = null;
            System.Xml.XmlText newTextNode = null;
            System.Xml.XmlNode testNode = null;
  
            testResults results = new testResults("Core0005T");
            try
            {
                results.description = "After the \"splitText(offset)\" method is invoked, the " +
                    "new Text node contains all of the content from the offset " +
                    "point to the end of the text.";
                //
                // Retrieve the targeted data.
                //
                testNode = util.nodeObject(util.THIRD,util.SECOND);
                oldTextNode = (System.Xml.XmlText)testNode.FirstChild;
                //
                // Split the two lines of text into two different Text nodes.
                //
                newTextNode = oldTextNode.SplitText(util.SEVENTH);
                computedValue = newTextNode.Value;
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }

            //
            // Write out results
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData(); 

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:nobled,项目名称:mono,代码行数:40,代码来源:Text.cs


示例13: core0006T

	public void core0006T()
        {
            string computedValue = "";
            string expectedValue = "98551";
            System.Xml.XmlText oldTextNode = null;
            System.Xml.XmlText newTextNode = null;
            System.Xml.XmlNode testNode = null;

            testResults results = new testResults("Core0006T");
            try
            {
                results.description = "The \"splitText(offset)\" method returns the " +
                    "new Text node.";
                //
                // Retrieve the targeted data.
                //
                testNode = util.nodeObject(util.FIRST,util.SIXTH);
                oldTextNode = (System.Xml.XmlText)testNode.FirstChild;
                //
                // Split the two lines of text into two different Text nodes. 
                //
                newTextNode = oldTextNode.SplitText(30);
                computedValue = newTextNode.Value;
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }
            //
            // Write out results
            //
            results.expected = expectedValue;
            results.actual = computedValue;
    
            util.resetData();

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:nobled,项目名称:mono,代码行数:38,代码来源:Text.cs


示例14: core0002T

	public void core0002T()
        {
            string computedValue = "";
            string expectedValue = "1900 Dallas Road Dallas, Texas\n 98554";
            System.Xml.XmlNode testNode = null;
            System.Xml.XmlNode textBlock1 = null;
            System.Xml.XmlNode textBlock2 = null;
            System.Xml.XmlNode textBlock3 = null;
            System.Xml.XmlNode textBlock4 = null; 

            testResults results = new testResults("Core0002T");
            try
            {
                results.description = "If there is markup language in the content of the " +
                    "element then the content is parsed into a " +
                    "list of elements and Text that are the children of " +
                    "the element";
                //
                // This last child of the second employee should now have four children, 
                // two Text nodes and two EntityReference nodes.  Retrieve each one of them 
                // and in the case of EntityReferences retrieve their respective children. 
                //
                testNode = util.nodeObject(util.SECOND,util.SIXTH);
                textBlock1 = testNode.ChildNodes.Item(util.FIRST).FirstChild;
                textBlock2 = testNode.ChildNodes.Item(util.SECOND);
                textBlock3 = testNode.ChildNodes.Item(util.THIRD).FirstChild;
                textBlock4 = testNode.ChildNodes.Item(util.FOURTH);

                computedValue += textBlock1.Value;
                computedValue += textBlock2.Value;
                computedValue += textBlock3.Value;
                computedValue += textBlock4.Value;
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }

            //
            // Write out results
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:nobled,项目名称:mono,代码行数:46,代码来源:Text.cs


示例15: core0003T

	public void core0003T()
        {
            string computedValue = "";
            string expectedValue = "Jones";
            System.Xml.XmlText oldTextNode = null;
            System.Xml.XmlNode testNode = null;

            testResults results = new testResults("Core0003T");
            try
            {
                results.description = "The \"splitText(offset)\" method breaks the Text node " +
                    "into two Text nodes at the specified offset, keeping each " +
                    "node in the tree as siblings.";
                //
                // Retrieve the targeted data.
                //
                testNode = util.nodeObject(util.THIRD,util.SECOND);
                oldTextNode = (System.Xml.XmlText)testNode.FirstChild;
                //
                // Split the two lines of text into two different Text nodes. 
                //
                oldTextNode.SplitText(util.EIGHT);
                computedValue = oldTextNode.NextSibling.Value;
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }

            //
            //  Write out results
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:nobled,项目名称:mono,代码行数:39,代码来源:Text.cs


示例16: core0012NO

	public void core0012NO()
        {
            string computedValue = "";
            System.Xml.XmlNode testNode = null;
            string expectedValue = util.NOTATION_NODE.ToString();

            testResults results = new testResults("Core0012NO");
            try
            {
                results.description = "The nodeType attribute for a Notation Node "+
                    " should be set to the constant 12.";
                //
                // Get the targeted data.
                //
                testNode = util.getNotation("notation1");
                //
                // The nodeType attribute should be set to the value 12.
                //
                computedValue = ((int)testNode.NodeType).ToString();
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }
            //
            // write out results.
            //
            results.expected = expectedValue.ToString();
            results.actual = computedValue.ToString();

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:whereisaaron,项目名称:mono,代码行数:32,代码来源:Node.cs


示例17: core0021NO

	public void core0021NO()
        {
            string computedValue = "";
            string expectedValue = "#document";
            System.Xml.XmlNode testNodeNode = null;

            testResults results = new testResults("Core0021NO");
            results.description = "The nodeName attribute for a Document Node "+
                "should be set to \"#document\".";
            //
            // Get the targeted data.
            //
            System.Xml.XmlNode testNode = util.getDOMDocument();
            //
            // The nodeName attribute should be set to "#document". 
            //
            computedValue = testNode.Name;
            //
            // write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:whereisaaron,项目名称:mono,代码行数:25,代码来源:Node.cs


示例18: core0017NO

	public void core0017NO()
        {
            string computedValue = "";
            string expectedValue = "ent2";
            System.Xml.XmlNode testNode = null;
            System.Xml.XmlNode entRefNode = null;

            testResults results = new testResults("Core0017NO");
            try
            {
                results.description = "The nodeName attribute for an EntityReference Node " +
                    "should be set to the name of the entity referenced.";
                //
                // Retrieve the targeted data.
                //
                testNode = util.nodeObject(util.SECOND,util.SIXTH);
                entRefNode = testNode.FirstChild;//.node.
                //
                // The nodeName attribute should be set to "ent2".
                //
                computedValue = entRefNode.Name;
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }
            //
            // write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:whereisaaron,项目名称:mono,代码行数:34,代码来源:Node.cs


示例19: core0009T

	[Category ("NotDotNet")] // MS DOM is buggy
	public void core0009T()
        {
            string computedValue = "";
            System.Xml.XmlNode testNode = null;
            System.Xml.XmlText readOnlyText = null;
            string expectedValue = "System.ArgumentException";//util.NO_MODIFICATION_ALLOWED_ERR;

            testResults results = new testResults("Core0009T");
            try
            {
                results.description = "The \"splitText(offset)\" method raises a " +
                    "NO_MODIFICATION_ALLOWED_ERR Exception if the " +
                    "node is readonly.";
                //
                // Attempt to modify descendants of an EntityReference node should raise 
                // an exception. 
                //
                testNode = util.nodeObject(util.SECOND,util.SIXTH);
                readOnlyText = (System.Xml.XmlText)testNode.ChildNodes.Item(util.FIRST).FirstChild;

                try 
                {
                    readOnlyText.SplitText(5);
                }
                catch(ArgumentException ex) 
                {
                    computedValue = ex.GetType ().FullName; 
                }

            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }

            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:nobled,项目名称:mono,代码行数:43,代码来源:Text.cs


示例20: core0098NO

	public void core0098NO()
        {
            string computedValue = "";
            System.Xml.XmlElement newChild = (System.Xml.XmlElement)util.createNode(util.ELEMENT_NODE,"newChild");
            System.Xml.XmlElement refChild = (System.Xml.XmlElement)util.createNode(util.ELEMENT_NODE,"refChild");
            System.Xml.XmlNode testNode = null;
            string expectedValue = "System.ArgumentException";//util.NOT_FOUND2_ERR;

            testResults results = new testResults("Core0098NO");
            try
            {
                results.description = "The \"insertBefore\" method of a node raises "+
                    "a NOT_FOUND_ERR Exception if the reference "+
                    "child is not a child of this node.";
                //
                // Retrieve targeted data.
                //
                testNode = util.nodeObject(util.SECOND,-1);
                //
                // Attempt to insert before a reference child that is not a child of
                // this node should raise an exception.
                //
                try 
                {
                    testNode.InsertBefore(newChild,refChild);//.node.
                }
                catch(ArgumentException ex) 
                {
                    computedValue = ex.GetType ().FullName; 
                }
            }
            catch(System.Exception ex)
            {
                computedValue = "Exception " + ex.Message;
            }
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();

            Assert.AreEqual (results.expected, results.actual);
        }
开发者ID:whereisaaron,项目名称:mono,代码行数:42,代码来源:Node.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# nsDataMgr.objUnit类代码示例发布时间:2022-05-26
下一篇:
C# nicTest.diff_match_patchTest类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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