示例#1
0
        public void XmlNodeCreatorTest_EmptyString()
        {
            XmlNodeCreator creator = new XmlNodeCreator();
            XmlNode        node    = creator.Create(string.Empty);

            Assert.IsNull(node);
        }
示例#2
0
        public void XmlNodeCreatorTest_Kanonas()
        {
            string     folderPath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData");
            FileReader reader     = new FileReader(folderPath);
            string     xml        = reader.Read("KanonasRuleTest.xml");

            for (int i = 0; i < 1000; i++)
            {
                XmlNode node = new XmlNodeCreator().Create(xml);
            }
        }
示例#3
0
        public void XmlNodeCreatorTest_Valid()
        {
            string         xml     = @"<and>
		                        <equals><int>1</int><int>1</int></equals>
		                        <more><int>2</int><int>1</int></more>
	                        </and>"    ;
            XmlNodeCreator creator = new XmlNodeCreator();
            XmlNode        node    = creator.Create(xml);

            Assert.AreEqual("and", node.Name);
            Assert.AreEqual(2, node.ChildNodes.Count);
        }
示例#4
0
        public void XmlNodeCreatorTest_Comments()
        {
            string         xml     = @"<and>
                                <!-- ПРАВИЛА ДЛЯ КАНОНОВ-->
		                        <equals><int>1</int><int>1</int></equals>
		                        <more><int>2</int><int>1</int></more>
	                        </and>"    ;
            XmlNodeCreator creator = new XmlNodeCreator();
            XmlNode        node    = creator.Create(xml);

            Assert.AreEqual("and", node.Name);
            Assert.AreEqual(2, node.ChildNodes.Count);
        }