What problem does it solve?
Provide clear, consistent, and comprehensive guidance for writing xUnit-style assertions with the TestBox $assert object so developers can reliably validate expectations, reduce test errors, and standardize assertion patterns across test suites.
Core Features & Use Cases
- Comprehensive Assertion Reference: Covers boolean, equality, null/empty, size/length, key existence, inclusion, type checks, numeric comparisons, regex/string matching, exception assertions, and forced pass/fail/skip.
- Custom Assertions: Shows how to register inline or class-based assertion libraries with addAssertions for reusable, domain-specific checks.
- BoxLang Convenience Methods: Documents dynamic assertXxx() method usage in BoxLang for concise tests.
- Use Case: Validate API responses by asserting structure, required keys, types, and expected values, and register shared helpers for complex domain validations.
Quick Start
Write an xUnit test that uses $assert.isEqual to compare expected and actual values and register reusable assertions via addAssertions in beforeTests.