Files
English/kouyu_english/test/writing_feedback_test.dart
T

35 lines
925 B
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:kouyu_english/core/writing_feedback.dart';
void main() {
test('accepts a variable name in the first lesson', () {
final result = WritingFeedback.check('a0-01', 'Hello. I am Alex.');
expect(result.complete, isTrue);
});
test(
'requests the missing sentence frame without rejecting a valid place',
() {
expect(WritingFeedback.check('a0-06', 'Hong Kong.').complete, isFalse);
expect(
WritingFeedback.check('a0-06', "I'm from Shanghai.").complete,
isTrue,
);
},
);
test('requires the three independent parts in lesson ten', () {
expect(
WritingFeedback.check('a0-10', "I'm Alex. I'm from Beijing.").complete,
isFalse,
);
expect(
WritingFeedback.check(
'a0-10',
"I'm Alex. I'm from Beijing. I like tea.",
).complete,
isTrue,
);
});
}