SnapshotUpdateStrategy Class

public abstract class SnapshotUpdateStrategy

No documentation is available.

Constructors

NameDescription
SnapshotUpdateStrategy()

SnapshotUpdateStrategy()

protected SnapshotUpdateStrategy()

No documentation is available.

Properties

NameDescription
Default
DisallowDo not update the snapshots and fail the tests if the snapshots are different.
MergeToolOpen a merge tool to update the snapshots. You can specify the merge tools to use using InlineSnapshotSettings.MergeTools. The test fails if the snapshots are different.
MergeToolSyncOpen a merge tool to update the snapshots and wait for it to close before continuing the test execution. You can specify the merge tools to use using InlineSnapshotSettings.MergeTools. The test fails if the snapshots are different.
OverwriteOverwrite the source file with the new snapshot. The test fails if the snapshots are different.
OverwriteWithoutFailureOverwrite the source file with the new snapshot. The test won't fail.
ReuseTemporaryFile
public static SnapshotUpdateStrategy Default { get; }

No documentation is available.

Do not update the snapshots and fail the tests if the snapshots are different.

public static SnapshotUpdateStrategy Disallow { get; }

Open a merge tool to update the snapshots. You can specify the merge tools to use using InlineSnapshotSettings.MergeTools. The test fails if the snapshots are different.

public static SnapshotUpdateStrategy MergeTool { get; }

Open a merge tool to update the snapshots and wait for it to close before continuing the test execution. You can specify the merge tools to use using InlineSnapshotSettings.MergeTools. The test fails if the snapshots are different.

public static SnapshotUpdateStrategy MergeToolSync { get; }

Overwrite the source file with the new snapshot. The test fails if the snapshots are different.

public static SnapshotUpdateStrategy Overwrite { get; }

OverwriteWithoutFailure

SnapshotUpdateStrategy.cs

Overwrite the source file with the new snapshot. The test won't fail.

public static SnapshotUpdateStrategy OverwriteWithoutFailure { get; }

ReuseTemporaryFile

SnapshotUpdateStrategy.cs
public virtual bool ReuseTemporaryFile { get; }

Property value

bool

No documentation is available.

Methods

NameDescription
CanUpdateSnapshot(InlineSnapshotSettings, string, string?, string?)Indicates if an an inline snapshot must be updated
MustReportError(InlineSnapshotSettings, string)Indicates if an exception must be thrown when the snapshots differ.
ToString()
UpdateFile(InlineSnapshotSettings, string, string)

CanUpdateSnapshot(InlineSnapshotSettings, string, string?, string?)

Indicates if an an inline snapshot must be updated

public abstract bool CanUpdateSnapshot(InlineSnapshotSettings settings, string path, string? expectedSnapshot, string? actualSnapshot)

Parameters

settings InlineSnapshotSettings
path string
expectedSnapshot string?
actualSnapshot string?

Returns

bool

MustReportError(InlineSnapshotSettings, string)

Indicates if an exception must be thrown when the snapshots differ.

public abstract bool MustReportError(InlineSnapshotSettings settings, string path)

Parameters

settings InlineSnapshotSettings
path string

Returns

bool

public override string ToString()

Returns

string

No documentation is available.

UpdateFile(InlineSnapshotSettings, string, string)

public abstract void UpdateFile(InlineSnapshotSettings settings, string targetFile, string tempFile)

Parameters

settings InlineSnapshotSettings
targetFile string
tempFile string

No documentation is available.