Table of Contents

Class JsonDifference

Namespace
JsonAssertions
Assembly
JsonAssertions.TUnit.dll

The first structural difference found between two JSON documents by JsonEquivalence. Captures the location and a rendered description of each side at the point they diverge, so the difference outlives the JsonDocument it was found in (a JsonElement is valid only while its backing document is alive).

public sealed class JsonDifference
Inheritance
JsonDifference
Inherited Members
Extension Methods

Constructors

JsonDifference(string, JsonDifferenceKind, string, string)

Initializes a difference at path.

public JsonDifference(string path, JsonDifferenceKind kind, string expected, string actual)

Parameters

path string

The dot/bracket path where the documents diverge; empty for the root.

kind JsonDifferenceKind

The category of difference.

expected string

A rendered description of the expected side at path.

actual string

A rendered description of the actual side at path.

Properties

Actual

A rendered description of the actual side at Path.

public string Actual { get; }

Property Value

string

Expected

A rendered description of the expected side at Path.

public string Expected { get; }

Property Value

string

Kind

The category of difference.

public JsonDifferenceKind Kind { get; }

Property Value

JsonDifferenceKind

Path

The dot/bracket path where the documents diverge; empty for the root.

public string Path { get; }

Property Value

string