xmltest.cs

来自「工作流的基本资料(文档资料」· CS 代码 · 共 38 行

CS
38
字号
using System.Collections;
using System.Xml;
using NetBpm.Util.Xml;
using NUnit.Framework;
using XmlElement = NetBpm.Util.Xml.XmlElement;

namespace NetBpm.Test.Util
{
	[TestFixture]
	public class XMLTest
	{
		public XMLTest()
		{
		}

		[Test]
		public void TestXmlParser()
		{
			XmlTextReader exampleXml = new XmlTextReader(
				TestHelper.GetExampleDir()+"process\\holiday\\processdefinition.xml");
			XmlParser xmlParser = new XmlParser(exampleXml);
			XmlElement element = xmlParser.Parse();

			XmlElement startstate = element.GetChildElement("start-state");
			Assert.IsNotNull(startstate);
			Assert.IsNotNull(startstate.GetAttribute("name"));

			XmlElement endstate = element.GetChildElement("end-state");
			Assert.IsNotNull(endstate);
			Assert.IsNotNull(endstate.GetAttribute("name"));

			IList pdattr = element.GetChildElements("attribute");
			Assert.IsNotNull(pdattr);
			Assert.IsTrue(pdattr.Count > 1);
		}

	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?