Exemple #1
0
        /// <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));
        }
Exemple #2
0
 /// <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_))
 {
 }