Encloses the XML fragments within a "root" element.

Namespace:  MbUnit.Framework
Assembly:  MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public CustomXmlOptions Enclose { get; }
Visual Basic (Declaration)
Public ReadOnly Property Enclose As CustomXmlOptions

Remarks

The .NET XML parser (XmlReader) does not support multiple root elements. This option encloses the multiple elements within a unique root element.

Examples

CopyC#
[Test]
public void MyXmlTest()
{
    string expected = "<a/><b/><c/>"; // Multiple root elements!
    string actual = "<a/><b/><c/>";
    Assert.Xml.AreEqual(expected, actual, XmlOptions.Custom.EncloseInRootElement); // Pass!
}

See Also