Class SnapshotSettingsDefaults
- Namespace
- XBullet.EasyTesting.Snapshots
- Assembly
- XBullet.EasyTesting.Snapshots.Core.dll
Stores reusable snapshot settings as a template. Each call creates an independent settings object, avoiding cross-test interference even when the template is configured globally.
public sealed class SnapshotSettingsDefaults
- Inheritance
-
SnapshotSettingsDefaults
- Inherited Members
Constructors
SnapshotSettingsDefaults(Action<SnapshotSettings>)
Creates reusable defaults from a one-time configuration callback.
public SnapshotSettingsDefaults(Action<SnapshotSettings> configure)
Parameters
configureAction<SnapshotSettings>A non-null callback invoked synchronously once with a new mutable template. The callback must not retain the template for later mutation.
Properties
Global
Gets or sets the optional defaults used as the base for snapshot assertions. Configure this once while the test assembly is initialized. Each assertion receives an independent copy; explicit settings are merged into it and locally configured scalar values take precedence.
public static SnapshotSettingsDefaults? Global { get; set; }
Property Value
- SnapshotSettingsDefaults
The process-wide template reference, or null to use package and environment defaults. Reads and writes are atomic; configure it during test assembly initialization.
Methods
Create(Action<SnapshotSettings>?)
Creates an independent settings object and optionally applies local overrides.
public SnapshotSettings Create(Action<SnapshotSettings>? configure = null)
Parameters
configureAction<SnapshotSettings>An optional callback invoked synchronously once on the independent copy, or null for no local overrides.
Returns
- SnapshotSettings
A new settings object whose mutable collections and JSON options are independent.
ExtendGlobal(Action<SnapshotSettings>)
Creates settings from the global template, or package defaults when no global template is configured, and then applies per-assertion configuration.
public static SnapshotSettings ExtendGlobal(Action<SnapshotSettings> configure)
Parameters
configureAction<SnapshotSettings>A non-null callback invoked synchronously once on the new settings object.
Returns
- SnapshotSettings
Independent settings based on the global template or current package/environment defaults.