Exercise is not explicit, example function and summary don't explain what the tests intend. Program wants a function that takes maximum of 3 numbers, but tests compare only the highest of the 3 arguments.
void main() {
group('maxNum', () {
for (int i = 0; i < 50; i++) {
Random rnd = new Random();
int first = -100 + rnd.nextInt(200);
int second = -100 + rnd.nextInt(200);
int third = -100 + rnd.nextInt(200);
// this test checks for the maximum value on the list
test('maxNum(${first}, ${second}, ${third})', () {
expect(student.maxNum(first, second, third),
equals([first, second, third].reduce(max)));
});
}
});
}
The purpose was to let students know about ternary operators, and their existence in dart. It is not super necessary concept, but we wanted them to know about it.
Exercise is not explicit, example function and summary don't explain what the tests intend. Program wants a function that takes maximum of 3 numbers, but tests compare only the highest of the 3 arguments.
What is the purpose of the exercise?