Skip to content

Commit acbb489

Browse files
committed
More test
1 parent ceaf2ba commit acbb489

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

test/src/bool/is_false_validator_test.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,22 @@ void main() {
5757
// Assert
5858
expect(result, isNull);
5959
});
60+
61+
test(
62+
'should return the default error message if the value is true and no custom message is set',
63+
() {
64+
// Arrange
65+
const IsFalseValidator validator = IsFalseValidator();
66+
const bool value = true;
67+
68+
// Act
69+
final String? result = validator.validate(value);
70+
71+
// Assert
72+
expect(
73+
result,
74+
equals(FormBuilderLocalizations.current.mustBeFalseErrorText),
75+
);
76+
});
6077
});
6178
}

test/src/bool/is_true_validator_test.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,22 @@ void main() {
5757
// Assert
5858
expect(result, isNull);
5959
});
60+
61+
test(
62+
'should return the default error message if the value is true and no custom message is set',
63+
() {
64+
// Arrange
65+
const IsTrueValidator validator = IsTrueValidator();
66+
const bool value = false;
67+
68+
// Act
69+
final String? result = validator.validate(value);
70+
71+
// Assert
72+
expect(
73+
result,
74+
equals(FormBuilderLocalizations.current.mustBeTrueErrorText),
75+
);
76+
});
6077
});
6178
}

0 commit comments

Comments
 (0)