Skip to content
Novus Examples
xml6.5 KB

NUnit 3 — Test Result XML

The NUnit 3 test-run document, with a nested Assembly/TestFixture suite tree, an environment element and per-case seeds. NUnit has no separate error outcome, so the errored case appears as Failed with label="Error" and the report reads failed=2. Reports the same canonical run as the JUnit dialect files: 12 tests, 9 passed, 1 assertion failure, 1 error and 1 skip.

Preview — first 45 linesxml
<?xml version="1.0" encoding="UTF-8"?>
<test-run id="2" name="Checkout.Tests.dll" fullname="/builds/novus/Checkout.Tests.dll" testcasecount="12" result="Failed" total="12" passed="9" failed="2" inconclusive="0" skipped="1" asserts="34" engine-version="3.17.0" clr-version="8.0.7" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:29Z" duration="7.450">
  <test-suite type="Assembly" id="0-1000" name="Checkout.Tests.dll" fullname="/builds/novus/Checkout.Tests.dll" runstate="Runnable" testcasecount="12" result="Failed" duration="7.450" total="12" passed="9" failed="2" inconclusive="0" skipped="1" asserts="34">
    <environment framework-version="3.17.0" clr-version="8.0.7" os-version="Linux" platform="Linux" cwd="/builds/novus" machine-name="ci-runner-04" user="sample" culture="en-GB" uiculture="en-GB"/>
    <test-suite type="TestFixture" id="0-1001" name="PricingTest" fullname="cart.PricingTest" classname="cart.PricingTest" runstate="Runnable" testcasecount="5" result="Failed" duration="3.744" total="5" passed="4" failed="1" inconclusive="0" skipped="0" asserts="13">
      <test-case id="0-1002" name="appliesUnitPrice" fullname="cart.PricingTest.appliesUnitPrice" methodname="appliesUnitPrice" classname="cart.PricingTest" runstate="Runnable" seed="1088132921" result="Passed" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="0.643" asserts="3"/>
      <test-case id="0-1003" name="appliesQuantityMultiplier" fullname="cart.PricingTest.appliesQuantityMultiplier" methodname="appliesQuantityMultiplier" classname="cart.PricingTest" runstate="Runnable" seed="1088132921" result="Passed" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="0.659" asserts="3"/>
      <test-case id="0-1004" name="roundsHalfUpAtTwoDecimals" fullname="cart.PricingTest.roundsHalfUpAtTwoDecimals" methodname="roundsHalfUpAtTwoDecimals" classname="cart.PricingTest" runstate="Runnable" seed="1088132921" result="Passed" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="1.042" asserts="3"/>
      <test-case id="0-1005" name="rejectsNegativeQuantity" fullname="cart.PricingTest.rejectsNegativeQuantity" methodname="rejectsNegativeQuantity" classname="cart.PricingTest" runstate="Runnable" seed="1088132921" result="Passed" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="1.048" asserts="3"/>
      <test-case id="0-1006" name="appliesTaxToSubtotal" fullname="cart.PricingTest.appliesTaxToSubtotal" methodname="appliesTaxToSubtotal" classname="cart.PricingTest" runstate="Runnable" seed="1088132921" result="Failed" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="0.352" asserts="3">
        <failure>
          <message><![CDATA[expected:<12.60> but was:<12.59>]]></message>
          <stack-trace><![CDATA[java.lang.AssertionError: expected:<12.60> but was:<12.59>
	at cart.PricingTest.appliesTaxToSubtotal(PricingTest.java:88)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
]]></stack-trace>
        </failure>
      </test-case>
    </test-suite>
    <test-suite type="TestFixture" id="0-1007" name="DiscountTest" fullname="cart.DiscountTest" classname="cart.DiscountTest" runstate="Runnable" testcasecount="4" result="Passed" duration="2.067" total="4" passed="3" failed="0" inconclusive="0" skipped="1" asserts="10">
      <test-case id="0-1008" name="appliesPercentageDiscount" fullname="cart.DiscountTest.appliesPercentageDiscount" methodname="appliesPercentageDiscount" classname="cart.DiscountTest" runstate="Runnable" seed="1088132921" result="Passed" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="0.147" asserts="3"/>
      <test-case id="0-1009" name="stacksDiscountsInDeclaredOrder" fullname="cart.DiscountTest.stacksDiscountsInDeclaredOrder" methodname="stacksDiscountsInDeclaredOrder" classname="cart.DiscountTest" runstate="Runnable" seed="1088132921" result="Passed" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="0.327" asserts="3"/>
      <test-case id="0-1010" name="ignoresExpiredCoupon" fullname="cart.DiscountTest.ignoresExpiredCoupon" methodname="ignoresExpiredCoupon" classname="cart.DiscountTest" runstate="Runnable" seed="1088132921" result="Passed" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="0.893" asserts="3"/>
      <test-case id="0-1011" name="appliesLoyaltyTier" fullname="cart.DiscountTest.appliesLoyaltyTier" methodname="appliesLoyaltyTier" classname="cart.DiscountTest" runstate="Runnable" seed="1088132921" result="Skipped" label="Ignored" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="0.700" asserts="3">
        <reason>
          <message><![CDATA[loyalty tiers are disabled in the CI profile]]></message>
        </reason>
      </test-case>
    </test-suite>
    <test-suite type="TestFixture" id="0-1012" name="SessionTest" fullname="checkout.SessionTest" classname="checkout.SessionTest" runstate="Runnable" testcasecount="3" result="Failed" duration="1.639" total="3" passed="2" failed="1" inconclusive="0" skipped="0" asserts="7">
      <test-case id="0-1013" name="createsSessionForNewCart" fullname="checkout.SessionTest.createsSessionForNewCart" methodname="createsSessionForNewCart" classname="checkout.SessionTest" runstate="Runnable" seed="1088132921" result="Passed" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="0.783" asserts="3"/>
      <test-case id="0-1014" name="expiresSessionAfterTimeout" fullname="checkout.SessionTest.expiresSessionAfterTimeout" methodname="expiresSessionAfterTimeout" classname="checkout.SessionTest" runstate="Runnable" seed="1088132921" result="Failed" label="Error" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="0.695" asserts="3">
        <failure>
          <message><![CDATA[Connection refused: sessions.example.com:5432]]></message>
          <stack-trace><![CDATA[java.net.ConnectException: Connection refused: sessions.example.com:5432
	at checkout.SessionStore.open(SessionStore.java:41)
	at checkout.SessionTest.expiresSessionAfterTimeout(SessionTest.java:57)
]]></stack-trace>
        </failure>
      </test-case>
      <test-case id="0-1015" name="restoresCartOnResume" fullname="checkout.SessionTest.restoresCartOnResume" methodname="restoresCartOnResume" classname="checkout.SessionTest" runstate="Runnable" seed="1088132921" result="Passed" start-time="2026-08-07 09:14:22Z" end-time="2026-08-07 09:14:23Z" duration="0.161" asserts="3"/>
    </test-suite>
  </test-suite>
</test-run>

Specifications

Seed
61200
Encoding
UTF-8
Line Endings
LF
Format
NUnit 3 test-run
Tests
12
Passed
9
Failed
2
Skipped
1
Error Mapping
error becomes Failed label=Error
Has Environment Element
true

Testing contract

Expected to pass
Scenario
Convert an NUnit 3 result file to JUnit XML without losing the error distinction.
Expected result
failed=2 splits back into 1 assertion failure and 1 error using the label attribute, matching the JUnit dialect twins.

What is a .xml file?

XML (Extensible Markup Language) is a verbose, self-describing markup language using nested tags, attributes, and namespaces to represent structured, hierarchical data. It supports schemas, entities, and validation and underlies many document and data formats. It remains common in enterprise, publishing, and interchange contexts.

How to use this file

Use an example XML file to test parsers, namespace and schema validation, XPath queries, and protection against entity-expansion and external-entity attacks.

How to use this file for testing

“NUnit 3 — Test Result XML” is a deterministic Novus Examples fixture for Conversion testing, Log parsing, Error handling. The same content exported across many formats and linked as a group, so you can convert one and diff against the expected twin.

Documented properties for this file: seed 61200 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Test and coverage reports document their totals (suites, cases, passes, failures, skips, covered lines) in the spec table. Point your CI dashboard, coverage gate, or report converter at the file and assert those counts survive; format twins carry identical numbers so a conversion can be scored exactly.

Code examples

import xml.etree.ElementTree as ET

tree = ET.parse("nunit3-results.xml")
root = tree.getroot()
print(root.tag, [c.tag for c in root][:5])

Generated by generation/testing.py. Free for any use, no attribution required — license.