Пример #1
0
 public static void AssertXmlValid(Validator validator)
 {
     AssertEquals(validator.ValidationMessage, true, validator.IsValid);
 }
Пример #2
0
 public static void AssertXmlValid(XmlInput xmlInput)
 {
     Validator validator = new Validator(xmlInput);
     AssertXmlValid(validator);
 }
Пример #3
0
 /// <summary>Assert that a Validator instance returns true</summary>
 /// <param name="validator">The object that validates the XML</param>
 /// <param name="message">The message that will be displayed on failure</param>
 /// <param name="args">Arguments to be used in formatting the message</param>
 /// <seealso cref="XmlUnit.Validator"/>
 public static void IsValidXml(Validator validator, String message = "", Object[] args = null)
 {
     IsValidXml(validator, true, message, args);
 }
Пример #4
0
        /// <summary>Worker method to determine if a given piece of XML is valid</summary>
        /// <param name="validator">The object that validates the XML</param>
        /// <param name="assertion">true if asserting that the XML is valid</param>
        /// <param name="message">The message that will be displayed on failure</param>
        /// <param name="args">Arguments to be used in formatting the message</param>
        /// <seealso cref="XmlUnit.Validator"/>
        private static void IsValidXml(Validator validator, Boolean assertion, String message = "", Object[] args = null)
        {
            String msg = message;

              if (String.IsNullOrEmpty(message))
              {
            msg = validator.ValidationMessage;
              }

              if (assertion)
              {
            NUnit.Framework.Assert.IsTrue(validator.IsValid, msg, args);
              }
              else
              {
            NUnit.Framework.Assert.IsFalse(validator.IsValid, msg, args);
              }
        }
Пример #5
0
 public static void AssertXmlValid(Validator validator) {
   NUnit.Framework.Assert.IsTrue(validator.IsValid, validator.ValidationMessage);
 }