assertPositive method

void assertPositive({
  1. String? message,
})

Asserts that this number is positive (greater than zero).

Throws a test failure if this number is not positive.

  • message: Optional custom message for the failure reason.

Implementation

void assertPositive({String? message}) {
  expect(this > 0, isTrue,
      reason: message ?? 'Expected $this to be positive');
}