Skip to content

Commit 0d70a26

Browse files
committed
Add bool test
1 parent f97af06 commit 0d70a26

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/src/numeric/between_validator_test.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ void main() {
77
final String customErrorMessage = faker.lorem.sentence();
88

99
group('BetweenValidator -', () {
10+
group('bool', () {
11+
test('should return errorText when type is invalid', () {
12+
// Arrange
13+
const num min = 5;
14+
const num max = 10;
15+
final BetweenValidator<bool> validator =
16+
BetweenValidator<bool>(min, max, errorText: customErrorMessage);
17+
const bool value = true;
18+
19+
// Act
20+
final String? result = validator.validate(value);
21+
22+
// Assert
23+
expect(result, equals(customErrorMessage));
24+
});
25+
});
26+
1027
group('num', () {
1128
test('should return null if the value is exactly at the minimum boundary',
1229
() {

0 commit comments

Comments
 (0)