Forge.Parse 1.20.0

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

Forge.Parse 1.20.0

Structured JSON expectation matching for dynamic .NET tests.

Website: https://pjotrcasteel.github.io/Forge/ · NuGet: https://www.nuget.org/packages/Forge.Parse · Source: https://github.com/pjotrcasteel/Forge

Forge.Parse makes JSON assertions readable when IDs, timestamps and relationships are created at runtime.

Install

dotnet add package Forge.Parse --version 1.20.0

Five-minute start

using Forge.Parse;

JsonAssert.Matches(
    """
    {
      "id": "<Guid>",
      "state": "<OneOf:pending|active>",
      "reference": "<Regex:^ORD-[0-9]+$>",
      "createdAt": "<DateTimeOffset>"
    }
    """,
    actualJson);

Objects are partial by default: extra properties in the actual JSON do not create noise.

Dynamic relationships

{
  "id": "<Capture:serviceId>",
  "dependency": {
    "serviceId": "<Same:serviceId>"
  }
}

Use <Present> and <Missing> for property presence, and <<Guid>> when the literal string <Guid> is expected.

Matching modes

JsonMatchOptions.Partial;
JsonMatchOptions.Exact;
JsonMatchOptions.Unordered;
JsonMatchOptions.UnorderedSubset;

Target specific paths when needed:

var options = JsonMatchOptions.Partial
    .Ignore("$.metadata.generatedAt")
    .UseUnorderedArrayMatching("$.items");

Built-in expectations

Forge.Parse includes type, shape, string, numeric, array-count and relationship matchers such as:

<Guid>, <NotEmptyGuid>, <String>, <Int>, <Number>, <Bool>, <DateTimeOffset>, <Uri>, <Regex:...>, <OneOf:a|b>, <GreaterThan:10>, <ArrayMinCount:1>, <Capture:name>, <Same:name>.

Custom expectations can be implemented with IValueMatcher or DelegateValueMatcher.

Forge family

  • Forge.Delta — what changed inside this object?
  • Forge.Sync — how does current state become desired state?
  • Forge.Parse — does structured dynamic output satisfy this expectation?

Forge.Parse is test-oriented and does not own application behavior, persistence or execution.

.NET 10 · MIT.

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.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Forge.Parse:

Package Downloads
Forge.Parse.Reqnroll

Reqnroll DataTable integration for Forge.Parse structured JSON matching.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.20.0 135 9/29/2026

Forge.Parse joins the Forge family with structured JSON expectation matching, dynamic placeholders, capture/reuse semantics, custom matchers, and structured diagnostics.