Table of Contents

Class DiffSuggestion

Namespace
SnapshotAssertions
Assembly
SnapshotAssertions.dll

One scrubber recommendation surfaced by DiffSuggestionAnalyzer on a snapshot-mismatch diff. The analyzer scans the differing lines of the diff for known volatile patterns (GUID canonical, GUID N-format, ISO 8601 timestamps, Unix epoch milliseconds, elapsed milliseconds) and emits one suggestion per pattern that has at least one hit, ordered by hit count descending.

public sealed record DiffSuggestion : IEquatable<DiffSuggestion>
Inheritance
DiffSuggestion
Implements
Inherited Members

Constructors

DiffSuggestion(string, int, string)

One scrubber recommendation surfaced by DiffSuggestionAnalyzer on a snapshot-mismatch diff. The analyzer scans the differing lines of the diff for known volatile patterns (GUID canonical, GUID N-format, ISO 8601 timestamps, Unix epoch milliseconds, elapsed milliseconds) and emits one suggestion per pattern that has at least one hit, ordered by hit count descending.

public DiffSuggestion(string PatternName, int Count, string Recommendation)

Parameters

PatternName string

A human-readable name for the matched pattern (e.g. "GUID", "ISO 8601 timestamp", "elapsed-ms value"). Used in the rendered failure-message suggestion line.

Count int

Number of regex matches across the differing lines of the diff. Strictly positive: zero-match patterns are not surfaced.

Recommendation string

A consumer-facing recommendation string suitable for direct inclusion in the failure message (e.g. "Consider .WithScrubber(Scrubbers.Guid)").

Properties

Count

Number of regex matches across the differing lines of the diff. Strictly positive: zero-match patterns are not surfaced.

public int Count { get; init; }

Property Value

int

PatternName

A human-readable name for the matched pattern (e.g. "GUID", "ISO 8601 timestamp", "elapsed-ms value"). Used in the rendered failure-message suggestion line.

public string PatternName { get; init; }

Property Value

string

Recommendation

A consumer-facing recommendation string suitable for direct inclusion in the failure message (e.g. "Consider .WithScrubber(Scrubbers.Guid)").

public string Recommendation { get; init; }

Property Value

string