ZplAssertSettings
public sealed class ZplAssertSettingsProcess-wide defaults for ZplAssert.
Constructors
| Signature | Description |
|---|---|
# ZplAssertSettings() |
Properties
| Property | Type | Description |
|---|---|---|
AcceptSnapshots { get; set; } | bool | Accept snapshots instead of failing: true when ZplAssertSettings.AcceptEnvironmentVariable is set to 1/true/yes. Can also be set in code (e.g. from a test run parameter). |
Dpi { get; set; } | int | Default print resolution (203 dpi). |
ExceptionFactory { get; set; } | Func<ZplAssertionException, Exception> | Creates the exception that is thrown for failed assertions. Default ZplTestFrameworks.AutoDetect (NUnit/MSTest assertion exceptions when that framework is loaded, else ZplAssertionException). |
FailOnMissingSnapshot { get; set; } | bool | Fail when an approved snapshot is missing (default true). The received image is always written so it can be reviewed and accepted; with false a missing snapshot is written as approved and the assertion passes. |
FailureImageDirectory { get; set; } | string | Folder of the failure images (default: zplcore-failures in the test output folder, or the folder in ZplAssertSettings.FailureDirectoryEnvironmentVariable). |
HeightMm { get; set; } | double | Default label height in mm when the ZPL has no ^LL (6 in). |
SnapshotDirectory { get; set; } | string | Folder for snapshots, relative to the test source file (default __snapshots__ next to the test class) or absolute. |
SnapshotTolerance { get; set; } | SnapshotTolerance | Default pixel tolerance of LabelAssertions.MatchesSnapshot (exact). |
WidthMm { get; set; } | double | Default label width in mm when the ZPL has no ^PW (4 in). |
WriteFailureImages { get; set; } | bool | Write an annotated PNG for every failure (failing elements outlined) and put its path into the message. Default on. |
Fields & Constants
| Field | Type | Description |
|---|---|---|
const AcceptEnvironmentVariable = "ZPLCORE_ACCEPT_SNAPSHOTS" | string | Environment variable that accepts snapshots: 1/true writes every received snapshot as approved. |
const FailureDirectoryEnvironmentVariable = "ZPLCORE_FAILURE_DIR" | string | Environment variable that overrides ZplAssertSettings.FailureImageDirectory. |

