assertOdd method

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

Asserts that this number is odd.

Throws a test failure if this number is not odd.

  • message: Optional custom message for the failure reason.

Implementation

void assertOdd({String? message}) {
  expect(this % 2 != 0, isTrue,
      reason: message ?? 'Expected $this to be odd');
}