Class SnapshotScrubberState
- Namespace
- SnapshotAssertions
- Assembly
- SnapshotAssertions.dll
Per-snapshot scrubber state. Maps each original volatile value (a specific GUID, a specific
ISO 8601 timestamp, a specific Unix-millis number, etc.) to a stable index, so the same
recurring value across the snapshot renders as the same indexed token. State lives for the
duration of a single MatchesSnapshot() evaluation and is discarded afterwards.
public sealed class SnapshotScrubberState
- Inheritance
-
SnapshotScrubberState
- Inherited Members
Methods
GetOrAssignIndex(string, string)
Looks up the index assigned to originalValue within the
kind namespace. If the value has not been seen before, assigns and
returns the next available index for that kind (zero-based, monotonically increasing).
public int GetOrAssignIndex(string kind, string originalValue)
Parameters
kindstringThe scrubber-defined kind namespace (e.g.
"guid","iso8601","unixms"). Different kinds maintain independent index counters.originalValuestringThe exact substring observed in the snapshot. Equality is ordinal: callers normalise the matched text (e.g. lower-casing GUIDs) before look-up when case-insensitive equality is desired.
Returns
- int
The zero-based index of the value within its kind namespace.
Exceptions
- ArgumentNullException
A required argument is null.