public static void AssertXmlValid(Validator validator) { AssertEquals(validator.ValidationMessage, true, validator.IsValid); }
public static void AssertXmlValid(XmlInput xmlInput) { Validator validator = new Validator(xmlInput); AssertXmlValid(validator); }
/// <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); }
/// <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); } }
public static void AssertXmlValid(Validator validator) { NUnit.Framework.Assert.IsTrue(validator.IsValid, validator.ValidationMessage); }