Test files this folder are used by the SqlXml.CreateReader() tests to confirm the API can process both Text and SQL Binary XML formats, and that processed SQL Binary XML matches the expected baseline text representations.
These files serve two purposes:
- They are the baselines used for validating the behavior of processing the
SqlBinaryXmlfiles - They are also used to validate
SqlXml.CreateReader()can process text files
These files are generated by converting the SqlBinaryXml files to text, using the SqlXml.CreateReader() API and the following code snippet.
string sqlBinaryXmlFile = @"SqlBinaryXml\file.bmx";
string textXmlFile = @"Baseline-Text\file.xml";
using FileStream sqlBinaryXmlStream = new FileStream(sqlBinaryXmlFile, FileMode.Open);
SqlXml sqlXml = new(sqlBinaryXmlStream);
using XmlReader sqlXmlReader = sqlXml.CreateReader();
using XmlWriter xmlWriter = new XmlTextWriter(textXmlFile, Encoding.UTF8);
while (sqlXmlReader.Read())
{
xmlWriter.WriteNode(sqlXmlReader, false);
}Because these files are treated as the baselines for the SqlBinaryXml validation, they must not be edited independently from the SqlBinaryXml files. Even whitespace and formatting changes will cause the tests to fail.
These files are stored in SQL Binary XML (MS-BINXML) format, representing a variety of scenarios salient for SqlXml scenarios.
The SqlXml.CreateReader() tests process these files and then validate that the results match the XML loaded from the corresponding files in the Baseline-Text folder. Therefore, there must be a 1:1 match between the files in the two folders.