16 lines
567 B
Dart
16 lines
567 B
Dart
|
|
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);
|
||
|
|
});
|
||
|
|
}
|