25 lines
616 B
Dart
25 lines
616 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:arcx/features/scoring/application/score_math.dart';
|
|
|
|
void main() {
|
|
group('ScoreMath', () {
|
|
test('center hit scores 10', () {
|
|
expect(ScoreMath.scoreFor(0, 0), 10);
|
|
});
|
|
|
|
test('outer edge scores low', () {
|
|
expect(ScoreMath.scoreFor(0.95, 0), 1);
|
|
});
|
|
|
|
test('beyond radius is a miss (0)', () {
|
|
expect(ScoreMath.scoreFor(1.2, 0), 0);
|
|
});
|
|
|
|
test('distance from center is non-negative', () {
|
|
expect(ScoreMath.distance(0, 0), 0);
|
|
expect(ScoreMath.distance(1, 0), closeTo(1, 0.0001));
|
|
});
|
|
});
|
|
}
|