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
pathstringThe dot/bracket path where the documents diverge; empty for the root.
kindJsonDifferenceKindThe category of difference.
expectedstringA rendered description of the expected side at
path.actualstringA 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
Expected
A rendered description of the expected side at Path.
public string Expected { get; }
Property Value
Kind
The category of difference.
public JsonDifferenceKind Kind { get; }
Property Value
Path
The dot/bracket path where the documents diverge; empty for the root.
public string Path { get; }