Class SnapshotMaintenance

Namespace
XBullet.EasyTesting.Snapshots
Assembly
XBullet.EasyTesting.Snapshots.Core.dll

Provides explicit preview-and-confirm operations for snapshot maintenance.

public static class SnapshotMaintenance
Inheritance
SnapshotMaintenance
Inherited Members

Methods

AcceptReceivedSnapshots(string, bool)

Accepts every received snapshot below a directory. Set confirmed to true only after reviewing FindReceivedSnapshots(string).

public static IReadOnlyList<string> AcceptReceivedSnapshots(string directory, bool confirmed = false)

Parameters

directory string

Non-empty absolute or current-directory-relative root to search recursively. A missing directory is accepted.

confirmed bool

true to authorize overwriting verified files and moving received files; the default false rejects the operation before changes begin.

Returns

IReadOnlyList<string>

Full paths of the verified files that received files were moved to, in case-insensitive path order.

FindReceivedSnapshots(string)

Finds received snapshots below a directory without changing any files.

public static IReadOnlyList<string> FindReceivedSnapshots(string directory)

Parameters

directory string

Non-empty absolute or current-directory-relative root to search recursively. A missing directory is accepted.

Returns

IReadOnlyList<string>

Full received-snapshot paths sorted case-insensitively, or an empty list when the directory does not exist.

RemoveVerifiedSnapshots(IEnumerable<string>, bool)

Removes the supplied verified snapshots. Every path is validated before any file is removed, and confirmed must be true.

public static IReadOnlyList<string> RemoveVerifiedSnapshots(IEnumerable<string> verifiedPaths, bool confirmed = false)

Parameters

verifiedPaths IEnumerable<string>

Non-null sequence of non-empty absolute or current-directory-relative verified-snapshot paths. The sequence is enumerated before deletion; duplicates are removed case-insensitively, and missing valid files are skipped.

confirmed bool

true to authorize permanent file deletion; the default false rejects the operation before enumeration or changes.

Returns

IReadOnlyList<string>

Full paths of files actually deleted, sorted case-insensitively. The returned files no longer exist.