This repository has been archived on 2026-10-23. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
halkyon_shared/packages/halkyon_app/test/instance/country_names_test.dart

16 lines
567 B
Dart
Raw Normal View History

import 'package:flutter_test/flutter_test.dart';
import 'package:halkyon_app/halkyon_app.dart';
void main() {
test('a country is named in the language asked for, else in English, and '
'one without a name not at all', () async {
final names = MemoryCountryNames({
'CH': {'de': 'Schweiz', 'en': 'Switzerland'},
});
expect(await names.nameOf('CH', 'de'), 'Schweiz');
expect(await names.nameOf('ch', 'de'), 'Schweiz');
expect(await names.nameOf('CH', 'ja'), 'Switzerland');
expect(await names.nameOf('XX', 'en'), isNull);
});
}