Beispiel #1
0
        public void UpdateNodeInfoTest()
        {
            string strFilePath   = Environment.CurrentDirectory + "\\LayoutSetting.xml";
            string strParertName = "LayoutSetting";
            string strNodeName   = "SetingInfo1";
            string strField      = "key1";
            string strValue      = "123";
            bool   bolResult     = XmlUse.UpdateNodeInfo(strFilePath, strParertName, strNodeName, strField, strValue, true);

            Assert.IsTrue(bolResult);
        }
Beispiel #2
0
        public void UpdateNodeInfoTest1()
        {
            string strFilePath   = Environment.CurrentDirectory + "\\LayoutSetting.xml";
            string strParertName = "LayoutSetting";
            string strNodeName   = "SetingInfo";

            string[] strsField = new string[] { "key", "value", "defaultvalue" };
            string[] strsValue = new string[] { "123", "123", "123" };
            bool     bolResult = XmlUse.UpdateNodeInfo(strFilePath, strParertName, strNodeName, strsField, strsValue);

            Assert.IsTrue(bolResult);
        }
Beispiel #3
0
        public void UpdateNodeInfoTest2()
        {
            string  strFilePath   = Environment.CurrentDirectory + "\\LayoutSetting.xml";
            string  strParertName = "LayoutSetting";
            string  strNodeName   = "SetingInfo";
            XmlNode node          = XmlUse.GetNodeInfo(strFilePath, strParertName, strNodeName);
            //node.Attributes.Append(new XmlAttribute)
            XmlElement element = (XmlElement)node;

            element.SetAttribute("TestAttr", "TestAttrValue");
            bool bolResult = XmlUse.UpdateNodeInfo(strFilePath, strParertName, node);

            Assert.IsTrue(bolResult);
        }