SnapshotUpdateStrategy Class
public abstract class SnapshotUpdateStrategyNo documentation is available.
Constructors
| Name | Description |
|---|---|
| SnapshotUpdateStrategy() |
SnapshotUpdateStrategy()
protected SnapshotUpdateStrategy()No documentation is available.
Properties
| Name | Description |
|---|---|
| Default | |
| Disallow | Do not update the snapshots and fail the tests if the snapshots are different. |
| MergeTool | 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. |
| MergeToolSync | 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. |
| Overwrite | Overwrite the source file with the new snapshot. The test fails if the snapshots are different. |
| OverwriteWithoutFailure | Overwrite the source file with the new snapshot. The test won't fail. |
| ReuseTemporaryFile |
Default
SnapshotUpdateStrategy.csDisallow
SnapshotUpdateStrategy.csDo not update the snapshots and fail the tests if the snapshots are different.
public static SnapshotUpdateStrategy Disallow { get; }Property value
MergeTool
SnapshotUpdateStrategy.csOpen 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; }Property value
MergeToolSync
SnapshotUpdateStrategy.csOpen 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; }Property value
Overwrite
SnapshotUpdateStrategy.csOverwrite the source file with the new snapshot. The test fails if the snapshots are different.
public static SnapshotUpdateStrategy Overwrite { get; }Property value
OverwriteWithoutFailure
SnapshotUpdateStrategy.csOverwrite the source file with the new snapshot. The test won't fail.
public static SnapshotUpdateStrategy OverwriteWithoutFailure { get; }Property value
ReuseTemporaryFile
SnapshotUpdateStrategy.csMethods
| Name | Description |
|---|---|
| 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
settingsInlineSnapshotSettingspathstringexpectedSnapshotstring?actualSnapshotstring?
Returns
MustReportError(InlineSnapshotSettings, string)
Indicates if an exception must be thrown when the snapshots differ.
public abstract bool MustReportError(InlineSnapshotSettings settings, string path)ToString()
SnapshotUpdateStrategy.csUpdateFile(InlineSnapshotSettings, string, string)
public abstract void UpdateFile(InlineSnapshotSettings settings, string targetFile, string tempFile)Parameters
settingsInlineSnapshotSettingstargetFilestringtempFilestring
No documentation is available.