International.EInvoicing.Testing 1.1.0

dotnet add package International.EInvoicing.Testing --version 1.1.0
                    
NuGet\Install-Package International.EInvoicing.Testing -Version 1.1.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="International.EInvoicing.Testing" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="International.EInvoicing.Testing" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="International.EInvoicing.Testing" />
                    
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 International.EInvoicing.Testing --version 1.1.0
                    
#r "nuget: International.EInvoicing.Testing, 1.1.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 International.EInvoicing.Testing@1.1.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=International.EInvoicing.Testing&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=International.EInvoicing.Testing&version=1.1.0
                    
Install as a Cake Tool

International.EInvoicing.Testing

A test kit for electronic invoicing: sample documents that conform, a round-trip harness that proves nothing was lost, a corpus of documents that fight back, and assertions that read like the promise they defend.

dotnet add package International.EInvoicing.Testing

Framework-free — the assertions throw, which xUnit, NUnit, MSTest and a plain console app all understand.

Documents that conform

EInvoice invoice = SampleInvoices.Conforming();
EInvoice creditNote = SampleInvoices.ConformingCreditNote();
EInvoice awkward = SampleInvoices.WithSomethingUnmapped();

Each one passes EN 16931 as this library validates it, so when your test fails the fixture is not the suspect. Building a document the base norm accepts takes some thirty terms; that is where an afternoon goes. Pass your own profile and a configure callback to change one term and keep the rest correct.

Round trips

RoundTripResult result = RoundTrip.Check(library, receivedXml);

Expect.LostNothing(result);

The check is by element census, not by text. Byte equality is not promised and should never be asserted: namespace prefixes, insignificant whitespace and attribute order are not normative. What must hold is that no element the original carried is missing from the result — including the ones the model has no field for.

RoundTrip.Check(library, invoice, format) starts from a model instead, which tests the other half: that what the writer emits, the reader understands.

Documents that fight back

foreach (HostileDocument document in HostileDocuments.All)
{
    DocumentResult result = library.Read(document.Xml);       // must not throw
    result.IsUsable.ShouldBe(document.StaysUsable);
}

A profile nobody registered, a date in a format nobody agreed to, an amount with a comma, an element with no business term, XML that stops halfway, a zero-byte file. Point them at your reader and your profile: if one of them throws, the promise is broken for whoever integrates with you.

Assertions

Expect.Conforming(report) No rule failed and every rule set that applies ran
Expect.Failed(report, "BR-CO-10") The half of a rule's test that gets forgotten
Expect.Passed(report, "BR-CO-10")
Expect.Checked(report, "XRechnung") The report is about what you think it is about
Expect.Reported(result, "EIV1042") Reading reported a diagnostic by code
Expect.Usable(result) Something usable came out, whatever had to be given up
Expect.LostNothing(roundTrip)
Expect.Raw(invoice.IssueDate, "20260901") The field kept the text the document carried

The messages carry the evidence — which rules fired, which rule sets did not run, what was reported instead. An assertion that fails with "expected true, was false" costs an hour.

Expect.Conforming is deliberately stricter than "no errors": a document judged by fewer rule sets than apply to it is unchecked, not valid, and a test that accepts the first as the second passes while proving nothing.

Part of International.EInvoicing.

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.0 137 9/7/2026
1.0.1-alpha.0.3 72 9/7/2026
1.0.1-alpha.0.2 71 9/7/2026
1.0.1-alpha.0.1 74 9/7/2026
1.0.0 112 9/5/2026
0.1.0-preview.1.107 68 9/5/2026
0.1.0-preview.1.106 63 9/4/2026
0.1.0-preview.1.105 77 9/4/2026
0.1.0-preview.1.104 71 9/4/2026
0.1.0-preview.1.103 75 9/4/2026
0.1.0-preview.1.102 78 9/3/2026
0.1.0-preview.1.101 73 9/3/2026
0.1.0-preview.1.96 87 9/3/2026
0.1.0-preview.1.95 75 9/3/2026
0.1.0-preview.1.94 77 9/3/2026
0.1.0-preview.1.93 68 9/3/2026
0.1.0-preview.1.92 72 9/3/2026
0.1.0-preview.1.91 71 9/3/2026
0.1.0-preview.1.90 78 9/3/2026
0.1.0-preview.1.89 70 9/3/2026
Loading failed