zplCore.comzplCore.com

ZplAssert

public static class ZplAssert

Entry point of the semantic label assertions. ZplAssert.Label(zpl) renders the label once and returns a fluent LabelAssertions object; every assertion checks what the label prints (decoded barcodes, measured positions, compliance rules) and throws a ZplAssertionException with the element position, the ZPL line and an annotated image path when it fails.

Properties

PropertyTypeDescription
static Settings { get; }ZplAssertSettingsProcess-wide defaults (snapshot folder, failure images, exception adapter). Set them once, e.g. in a module initializer.

Methods

Method SignatureReturnsDescription
static # Label(string zpl, ZplTestOptions? options = default)LabelAssertionsStarts assertions on ZPL code (all labels of the job; assertions apply to label 0 unless LabelAssertions.OnLabel selects another). zpl: ZPL II code (one or more ^XA…^XZ formats). · options: Resolution, label size, ^FN values …; null uses ZplAssert.Settings. · testName: Filled by the compiler: the calling test method, used to name failure images. · testFile: Filled by the compiler: the calling source file, used to find the snapshot folder.
static # Label(Label label, ZplTestOptions? options = default)LabelAssertionsStarts assertions on a label model (Label), converted with Label.ToZpl at the test resolution.
static # LabelFile(string path, ZplTestOptions? options = default)LabelAssertionsStarts assertions on a .zpl file or a label JSON file (Label.FromJson).