71 lines
2.7 KiB
Dart
71 lines
2.7 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:motorcycle_dash/models/motorcycle_models.dart';
|
|
import 'package:motorcycle_dash/services/motorcycle/local_motorcycle_data_provider.dart';
|
|
import 'package:motorcycle_dash/services/motorcycle/motorcycle_repository.dart';
|
|
import 'package:motorcycle_dash/features/performance/performance_timer_service.dart';
|
|
|
|
void main() {
|
|
TestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
group('Motorcycle Specifications Verification', () {
|
|
test('2001 Yamaha YZF-R6 returns factory-accurate engine specs', () async {
|
|
final repository = HybridMotorcycleRepository(
|
|
localProvider: LocalMotorcycleDataProvider(),
|
|
);
|
|
|
|
final spec = await repository.getSpecifications(
|
|
MotorcycleSelection(
|
|
year: 2001,
|
|
makeId: 'yamaha',
|
|
makeName: 'Yamaha',
|
|
modelId: 'yzf_r6',
|
|
modelName: 'YZF-R6',
|
|
),
|
|
);
|
|
|
|
expect(spec, isNotNull);
|
|
expect(spec!.displacementCc, equals(599));
|
|
expect(spec.cylinderCount, equals(4));
|
|
expect(spec.horsepower, equals(120.0));
|
|
expect(spec.horsepowerRpm, equals(13000));
|
|
expect(spec.torqueLbFt, equals(50.2));
|
|
expect(spec.redlineRpm, equals(15500));
|
|
expect(spec.wetWeightLbs, equals(414.0));
|
|
expect(spec.claimedTopSpeedMph, equals(160.0));
|
|
expect(spec.claimedZeroToSixtySec, equals(3.0));
|
|
});
|
|
|
|
test('Single-digit model names (R1, R7, R3) match displacement and cylinder counts correctly', () async {
|
|
final provider = LocalMotorcycleDataProvider();
|
|
|
|
final r1Spec = await provider.getSpecifications(
|
|
MotorcycleSelection(year: 2024, makeId: 'yamaha', makeName: 'Yamaha', modelId: 'r1', modelName: 'YZF-R1'),
|
|
);
|
|
expect(r1Spec, isNotNull);
|
|
expect(r1Spec!.displacementCc, equals(998));
|
|
expect(r1Spec.cylinderCount, equals(4));
|
|
|
|
final r7Spec = await provider.getSpecifications(
|
|
MotorcycleSelection(year: 2024, makeId: 'yamaha', makeName: 'Yamaha', modelId: 'r7', modelName: 'YZF-R7'),
|
|
);
|
|
expect(r7Spec, isNotNull);
|
|
expect(r7Spec!.displacementCc, equals(689));
|
|
expect(r7Spec.cylinderCount, equals(2));
|
|
|
|
final r3Spec = await provider.getSpecifications(
|
|
MotorcycleSelection(year: 2024, makeId: 'yamaha', makeName: 'Yamaha', modelId: 'r3', modelName: 'YZF-R3'),
|
|
);
|
|
expect(r3Spec, isNotNull);
|
|
expect(r3Spec!.displacementCc, equals(321));
|
|
expect(r3Spec.cylinderCount, equals(2));
|
|
});
|
|
});
|
|
|
|
group('Performance Timer Subsystem', () {
|
|
test('Timer targets and states exist and arm properly', () async {
|
|
expect(PerformanceTarget.sixty, isNotNull);
|
|
expect(PerformanceState.ready, isNotNull);
|
|
});
|
|
});
|
|
}
|