示例#1
0
        public void CreateXmlAttributeTest(string name, string value, bool escapeValue, string expectedName, string expectedValue, bool expectedEmpty)
        {
            XmlAttribute attribute = XmlAttribute.CreateXmlAttribute(name, value, true, escapeValue);

            Assert.Multiple(() =>
            {
                Assert.AreEqual(attribute.Name, expectedName);
                Assert.AreEqual(attribute.Value, expectedValue);
                Assert.AreEqual(attribute.IsEmpty, expectedEmpty);
            });
        }
示例#2
0
 [TestCase(null, false, false)]       // invalid
 public void NameErrorTest(string name, bool skipNameCheck, bool expected)
 {
     try
     {
         XmlAttribute.CreateXmlAttribute(name, null, skipNameCheck, false);
         if (!expected)
         {
             Assert.Fail();
             return;
         }
     }
     catch (Exception e)
     {
         if (expected)
         {
             Assert.Fail();
         }
     }
 }