platform/test/basic_test.dart
2016-12-25 20:09:24 -05:00

19 lines
456 B
Dart

import 'package:angel_validate/angel_validate.dart';
import 'package:test/test.dart';
final Validator todoSchema = new Validator({
'id': [isInt, isPositive],
'text*': isString,
'completed*': isBool
}, defaultValues: {
'completed': false
});
main() {
test('todo', () {
expect(() {
todoSchema
.enforce({'id': 'fool', 'text': 'Hello, world!', 'completed': 4});
}, throwsA(new isInstanceOf<ValidationException>()));
});
}