public void XmlNodeCreatorTest_EmptyString() { XmlNodeCreator creator = new XmlNodeCreator(); XmlNode node = creator.Create(string.Empty); Assert.IsNull(node); }
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); } }
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); }
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); }