zplCore.comzplCore.com

ZplAssertSettings

public sealed class ZplAssertSettings

Process-wide defaults for ZplAssert.

Constructors

SignatureDescription
# ZplAssertSettings()

Properties

PropertyTypeDescription
AcceptSnapshots { get; set; }boolAccept 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; }intDefault 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; }boolFail 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; }stringFolder of the failure images (default: zplcore-failures in the test output folder, or the folder in ZplAssertSettings.FailureDirectoryEnvironmentVariable).
HeightMm { get; set; }doubleDefault label height in mm when the ZPL has no ^LL (6 in).
SnapshotDirectory { get; set; }stringFolder for snapshots, relative to the test source file (default __snapshots__ next to the test class) or absolute.
SnapshotTolerance { get; set; }SnapshotToleranceDefault pixel tolerance of LabelAssertions.MatchesSnapshot (exact).
WidthMm { get; set; }doubleDefault label width in mm when the ZPL has no ^PW (4 in).
WriteFailureImages { get; set; }boolWrite an annotated PNG for every failure (failing elements outlined) and put its path into the message. Default on.

Fields & Constants

FieldTypeDescription
const AcceptEnvironmentVariable = "ZPLCORE_ACCEPT_SNAPSHOTS"stringEnvironment variable that accepts snapshots: 1/true writes every received snapshot as approved.
const FailureDirectoryEnvironmentVariable = "ZPLCORE_FAILURE_DIR"stringEnvironment variable that overrides ZplAssertSettings.FailureImageDirectory.