assertPositive method
Asserts that this number is positive (greater than zero).
Throws a test failure if this number is not positive.
Example:
5.assertPositive(); // Passes
0.assertPositive(); // Fails
(-5).assertPositive(); // Fails
message
: Optional custom message for the failure reason.
Implementation
void assertPositive({String? message}) {
expect(this > 0, isTrue,
reason: message ?? 'Expected $this to be positive');
}