Skip to content

Commit 3c01816

Browse files
committed
Validate test added
1 parent 33c1633 commit 3c01816

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'package:flutter_test/flutter_test.dart';
2+
import 'package:taskwarrior/app/utils/taskfunctions/validate.dart';
3+
4+
void main() {
5+
test('validateTaskDescription', () {
6+
expect(() => validateTaskDescription('Write test cases'), returnsNormally);
7+
8+
expect(() => validateTaskDescription(''), throwsFormatException);
9+
10+
expect(() => validateTaskDescription('Do something\\'), throwsFormatException);
11+
});
12+
13+
test('validateTaskProject', () {
14+
expect(() => validateTaskProject('Personal'), returnsNormally);
15+
16+
expect(() => validateTaskProject('Work\\'), throwsFormatException);
17+
});
18+
19+
test('validateTaskTags', () {
20+
expect(() => validateTaskTags('important'), returnsNormally);
21+
22+
expect(() => validateTaskTags('urgent tasks'), throwsFormatException);
23+
});
24+
}

0 commit comments

Comments
 (0)