Precept.Files 0.11.1

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

Precept.Files

Excel, CSV, JSON and XML files for Precept tests. Write a workbook or a CSV from a data table or a query result, append a row to a file the system under test produced, read a file back as rows, and build, query, change and assert on JSON and XML documents. Every file a test writes lands in its artifacts and is attached to its result.

dotnet add package Precept.Files
services.AddPreceptFiles();
// A Reqnroll DataTable's rows in, a spreadsheet out. The package never references Reqnroll:
// a row is anything dictionary-shaped, or an object whose properties are the columns.
var path = await Excel.WriteAsync("clients.xlsx", table.Rows, sheet: "Clients");

// A row appended under the columns the sheet already has, whatever their order:
using var export = Excel.Open("export.xlsx");
export.Sheet("Clients").AddRow(new { Name = "Acme", Email = "acme@example.test" });
await export.SaveAsync();

await Assert.That(export.Sheet("Clients")).ToContainRowsAsync(table.Rows);

var order = Json.New().Set("customer.id", 42).Set("lines", Json.Array(table.Rows));
await Assert.That(Json.Parse(response.Body).At("lines")).ToContainRowsAsync(table.Rows);

var shipment = Xml.Load("shipment.xml").WithDefaultNamespace("s");
await Assert.That(shipment).ToHaveValueAsync("/s:shipment/s:status", "accepted");

A sheet, a CSV file and a JSON array share one model, a header with rows under it by column name, and one set of row assertions. A bare file name is written into the running test's artifact directory, which is unique to the test and one step from every report. It is read from there first, then from beside the test binary. The ClosedXML worksheet, the JsonNode and the XDocument underneath are one property away, so nothing the libraries can do is out of reach.


Part of Precept, a .NET 10 test framework built on Microsoft.Testing.Platform. Full documentation: files · Excel · CSV · JSON · XML · where files go

Product Compatible and additional computed target framework versions.
.NET 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
0.11.1 47 9/16/2026
0.11.0 50 9/15/2026
0.10.0 72 9/10/2026
0.8.0 60 9/10/2026
0.7.0 70 9/9/2026