new UI + new targets.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:sd_kovinar/models/target_style.dart';
|
||||
|
||||
void main() {
|
||||
test('every target design has its image, and ids are unique', () {
|
||||
final ids = <int>{};
|
||||
for (final style in [...TargetStyle.all, ...TargetStyle.holidays]) {
|
||||
expect(ids.add(style.id), isTrue, reason: 'duplicate id ${style.id}');
|
||||
final asset = style.asset;
|
||||
if (style.isDefault) {
|
||||
expect(asset, isNull); // drawn as vectors
|
||||
} else {
|
||||
expect(File(asset!).existsSync(), isTrue, reason: '$asset missing');
|
||||
}
|
||||
}
|
||||
expect(TargetStyle.byId(13), TargetStyle.fallback); // removed skin falls back to the default
|
||||
expect(TargetStyle.all.length, 6); // the default and five designs
|
||||
expect(TargetStyle.byId(24), TargetStyle.fallback); // a design no longer shipped falls back too
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user