/// <summary> /// Overrides the match method to load the XML from file instead. /// </summary> /// <param name="xmlFilename_"></param> /// <returns></returns> public override bool Matches(string xmlFilename_) { if (null == xmlFilename_) { throw new ArgumentNullException(nameof(xmlFilename_)); } var xmlString = XmlFileLoader.LoadXmlFromFile(xmlFilename_); return(base.Matches(xmlString)); }
/// <summary> /// Loads the expected XML from a file instead of it being provided as a string but in all other regards /// this peforms identically to the <code>XmlSerializer</code> /// </summary> /// <param name="serializer_">T</param> /// <param name="refXmlFilename_">The filename of the file to read the expected XML output from</param> public XmlFileSerializerConstraint(IXmlSerializer <T> serializer_, string refXmlFilename_) : base(serializer_, XmlFileLoader.LoadXmlFromFile(refXmlFilename_)) { }