assertOdd method
Asserts that this number is odd.
Throws a test failure if this number is not odd.
Example:
1.assertOdd(); // Passes
3.assertOdd(); // Passes
5.assertOdd(); // Passes
2.assertOdd(); // Fails
0.assertOdd(); // Fails
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');
}