Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

System.Data.Common Test Files

SqlXml.CreateReader

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.

Baseline-Text

These files serve two purposes:

  1. They are the baselines used for validating the behavior of processing the SqlBinaryXml files
  2. 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.

SqlBinaryXml

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.