xUnit.net v1 XML Format
This documentation for the v1 XML format is provided for historical purposes only.
New transformations should use the V2 XML Format.
xUnit.net v1 exposed XML in several ways:
- As the native xUnit.net XML output;
- As the XML document used for output transformations;
- As the callback from Executor for version-resilient test runner authors.
The top level element of the document during transformation is the
assembly element, and represents a single test assembly.
During execution, the top level element will be the element currently being
reported on.
Elements
<assembly>
Element
The assembly
node contains information about the run of a test
assembly. Transformations are handed a single assembly node as their XML document
to transform against.
Child Elements
Child | Cardinality | Purpose |
<class> |
0..* |
The classes run within this assembly |
Attributes
Name | Value |
name |
The fully qualified pathname of the assembly |
run-date |
The date the test run began |
run-time |
The time the test run began |
time |
The time, in fractional seconds, spent running tests |
total |
The number of tests run |
passed |
The number of tests that passed |
failed |
The number of tests that failed |
skipped |
The number of tests that were skipped |
environment |
The environment the tests were run in (32- vs. 64-bit and .NET version) |
<class>
Element
The class
node contains information about the tests run in a single test
class. It also contains information about failures related to the class itself (i.e.,
during the creation or disposable of fixture data associated with
IUseFixture<T>
).
Child Elements
Child | Cardinality | Purpose |
<test> |
0..* |
Contains the tests run within this class |
<failure> |
0..1 |
Contains fixture related failure info |
Attributes
Name | Value |
name |
The full type name of the class |
time |
The time, in fractional seconds, spent running tests |
total |
The number of tests run |
passed |
The number of tests that passed |
failed |
The number of tests that failed |
skipped |
The number of tests that were skipped |
<failure>
Element
A failure
node describes a failure of a class
or test
.
Child Elements
Child | Cardinality | Purpose |
<message> |
1 |
The exception message |
<stack-trace> |
0..1 |
The stack trace of the exception |
Attributes
Name | Value |
exception-type |
The full type name of the exception that was thrown |
<reason>
Element
A reason node contains information about why a test was skipped.
Child Elements
Child | Cardinality | Purpose |
<message> |
1 |
The reason the text was skipped |
<start>
Element
The start node is only available via Executor, not for Transformations. It
indicates that a test is about to start running, and can be used to update
runner status to indicate such.
Attributes
Name | Value |
name |
The display name of the test |
type |
The full type name of the class |
method |
The name of the method |
<test>
Element
The test node contains information about a single test execution.
Child Elements
Child | Cardinality | Purpose |
<failure> |
0..1 |
Present if the test result is Fail |
<reason> |
0..1 |
Present if the test result is Skip |
<traits> |
0..1 |
Present if the test has any trait metadata |
<output> |
0..1 |
Contains any text written to Console.Out or Console.Error |
Attributes
Attribute |
Introduced |
Value |
name |
1.0 |
The display name of the test |
type |
1.0 |
The full type name of the class |
method |
1.0 |
The name of the method |
result |
1.0 |
One of Pass , Fail , or Skip |
time |
1.0 |
The time, in fractional seconds, spent running the test (not present for
Skip results)
|
<trait>
Element
The trait node contains information about a single name/value pair of metadata
about a test
.
Attributes
Name | Value |
name |
The name of the trait |
value |
The value of the trait |
<traits>
Element
The traits node contains zero or more trait
nodes which
contain the metadata about a test
.
Child Elements
Child | Cardinality | Purpose |
<trait> |
0..* |
Nodes representing the traits of the test
|