DemaConsulting.TestResults 1.9.0

Prefix Reserved
dotnet add package DemaConsulting.TestResults --version 1.9.0
                    
NuGet\Install-Package DemaConsulting.TestResults -Version 1.9.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DemaConsulting.TestResults" Version="1.9.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DemaConsulting.TestResults" Version="1.9.0" />
                    
Directory.Packages.props
<PackageReference Include="DemaConsulting.TestResults" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DemaConsulting.TestResults --version 1.9.0
                    
#r "nuget: DemaConsulting.TestResults, 1.9.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DemaConsulting.TestResults@1.9.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DemaConsulting.TestResults&version=1.9.0
                    
Install as a Cake Addin
#tool nuget:?package=DemaConsulting.TestResults&version=1.9.0
                    
Install as a Cake Tool

TestResults

GitHub forks GitHub stars GitHub contributors License Build Quality Gate Security NuGet

.NET library for TRX and JUnit test results

Overview

A .NET library for reading and writing test result files in multiple formats. Provides an in-memory model for test outcomes and results, supporting serialization to/from TRX (Visual Studio Test Results) and JUnit XML formats.

Features

  • âœĻ Simple API - Intuitive and easy-to-use object model for test results
  • ðŸŽŊ Type-Safe - Strongly-typed C# classes for test outcomes and results
  • ðŸŠķ Lightweight - Zero runtime dependencies
  • 🔄 Multi-Target - Supports .NET Standard 2.0, .NET 8, 9, and 10
  • ðŸ“Ķ NuGet Ready - Easy integration via NuGet package
  • 📊 Multiple Formats - Supports both TRX and JUnit XML formats
  • ✅ Compatible - Works with Visual Studio, Azure DevOps, and CI/CD systems
  • 🔒 Continuous Compliance - Compliance evidence generated automatically on every CI run, following the Continuous Compliance methodology

Installation

dotnet add package DemaConsulting.TestResults

Or via Package Manager Console:

Install-Package DemaConsulting.TestResults

Usage

using DemaConsulting.TestResults;
using DemaConsulting.TestResults.IO;

// Create a TestResults instance
var results = new TestResults { Name = "SomeTests" };

// Add test results
results.Results.Add(new TestResult
{
    Name = "Test1",
    ClassName = "SomeTestClass",
    CodeBase = "MyTestAssembly",
    Outcome = TestOutcome.Passed,
    Duration = TimeSpan.FromSeconds(1.5),
    StartTime = DateTime.UtcNow
});

results.Results.Add(new TestResult
{
    Name = "Test2",
    ClassName = "SomeTestClass",
    CodeBase = "MyTestAssembly",
    Outcome = TestOutcome.Failed,
    ErrorMessage = "Expected value to be 42 but was 0",
    ErrorStackTrace = "at SomeTestClass.Test2() in Test.cs:line 15"
});

// Save as TRX (Visual Studio format)
File.WriteAllText("results.trx", TrxSerializer.Serialize(results));

// Save as JUnit XML
File.WriteAllText("results.xml", JUnitSerializer.Serialize(results));

The library can automatically detect and convert between formats:

using DemaConsulting.TestResults.IO;

// Automatically detect and deserialize any supported format
var results = Serializer.Deserialize(File.ReadAllText("test-results.xml"));

// Convert JUnit to TRX
var junitResults = JUnitSerializer.Deserialize(File.ReadAllText("junit-results.xml"));
File.WriteAllText("converted.trx", TrxSerializer.Serialize(junitResults));

Test Outcomes

The library supports the following test outcomes via the TestOutcome enum:

Successful: Passed, PassedButRunAborted, Warning

Failure: Failed, Error, Timeout, Aborted

Skipped/Not Run: NotExecuted, NotRunnable, Pending

Other: Completed, Inconclusive, Disconnected, InProgress

Helper extension methods: IsPassed(), IsFailed(), IsExecuted()

Building

pwsh ./build.ps1

API Documentation

Detailed API documentation for all public types and members is distributed in the api/ folder of the NuGet package.

User Guide

The TestResults User Guide is available on the TestResults releases page.

Contributing

See CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License — see LICENSE.

Support

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.9.0 1,954 6/1/2026
1.8.0 175 5/28/2026
1.7.0 6,594 4/3/2026
1.6.0 3,579 3/13/2026
1.5.0 2,543 2/19/2026
1.4.0 1,629 1/28/2026
1.3.0 733 1/13/2026
1.2.0 633 1/8/2026
1.1.0 447 12/15/2025
1.0.0 565 5/4/2025
0.1.0-alpha.1 141 2/20/2025