Nullean.Snapshots.Objects
0.18.0
dotnet add package Nullean.Snapshots.Objects --version 0.18.0
NuGet\Install-Package Nullean.Snapshots.Objects -Version 0.18.0
<PackageReference Include="Nullean.Snapshots.Objects" Version="0.18.0" />
<PackageVersion Include="Nullean.Snapshots.Objects" Version="0.18.0" />
<PackageReference Include="Nullean.Snapshots.Objects" />
paket add Nullean.Snapshots.Objects --version 0.18.0
#r "nuget: Nullean.Snapshots.Objects, 0.18.0"
#:package Nullean.Snapshots.Objects@0.18.0
#addin nuget:?package=Nullean.Snapshots.Objects&version=0.18.0
#tool nuget:?package=Nullean.Snapshots.Objects&version=0.18.0
Nullean.Snapshots.Objects

Object-graph snapshots for Nullean.Snapshots: any object dumped by reflection as YAML, with cycles, unordered sets and throwing properties handled, so a property added to a type shows up as a diff by path.
Install
dotnet add package Nullean.Snapshots.Objects
Quick start
using AwesomeAssertions;
using Nullean.Snapshots.Objects;
public class NavigationTests
{
[Test]
public void Builds() =>
Navigation.Build(docset).Should().MatchObjectSnapshot(); // .verified.yml
[Test]
public void BuildsWithoutTheFileSystem() =>
Navigation.Build(docset).Should().MatchObjectSnapshot(
new ObjectDumpOptions().IgnoreType<IFileSystem>().IgnoreMember("Created").Render<Guid>(_ => "<guid>"));
}
Public instance properties and fields are written, maps by key, lists in order. A HashSet<T> is sorted by how its items render, so hash order does not make a diff. A reference back to an object on the path is "<cycle to $.Path>". A property that throws is "<throws InvalidOperationException>", without its message, which differs between operating systems.
Trimming and native AOT
This package reads members by reflection, so the call is marked [RequiresUnreferencedCode]. It still works under native AOT if the trimmer is told which types to keep: the root type is kept for you, name every other type in the graph with Include<T>(). A type without public members that was not named fails with a message that says so, instead of silently dumping as {}. Interfaces are not consulted to find sets (trimming removes them from a type's interface list), so a custom set type needs SortAsSet(typeof(MySet<>)). See DECISIONS.md in the repository for the AOT run this was checked with.
Documentation: https://snapshots.nullean.net/formats/objects/
| Product | Versions 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. net11.0 is compatible. |
-
net10.0
- Nullean.Snapshots (>= 0.18.0)
- Nullean.Snapshots.AwesomeAssertions (>= 0.18.0)
- Nullean.Snapshots.Yaml (>= 0.18.0)
-
net11.0
- Nullean.Snapshots (>= 0.18.0)
- Nullean.Snapshots.AwesomeAssertions (>= 0.18.0)
- Nullean.Snapshots.Yaml (>= 0.18.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.