40 lines
1.2 KiB
Dart
40 lines
1.2 KiB
Dart
|
|
import 'package:flutter_test/flutter_test.dart';
|
||
|
|
import 'package:halkyon_app/halkyon_app.dart';
|
||
|
|
import 'package:material_ui/material_ui.dart';
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
test('speaks British English, American English and German', () {
|
||
|
|
expect(
|
||
|
|
HalkyonAppLocalizations.supportedLocales,
|
||
|
|
containsAll(const [
|
||
|
|
Locale('en'),
|
||
|
|
Locale('en', 'GB'),
|
||
|
|
Locale('en', 'US'),
|
||
|
|
Locale('de'),
|
||
|
|
]),
|
||
|
|
);
|
||
|
|
});
|
||
|
|
|
||
|
|
test("names the app it is part of where its texts do, as Halkyon Learn's "
|
||
|
|
'own texts did', () {
|
||
|
|
final english = lookupHalkyonAppLocalizations(const Locale('en'));
|
||
|
|
final german = lookupHalkyonAppLocalizations(const Locale('de'));
|
||
|
|
|
||
|
|
expect(
|
||
|
|
english.instanceWelcome('Halkyon Learn'),
|
||
|
|
'Welcome to Halkyon Learn',
|
||
|
|
);
|
||
|
|
expect(
|
||
|
|
german.instanceWelcome('Halkyon Learn'),
|
||
|
|
'Willkommen bei Halkyon Learn',
|
||
|
|
);
|
||
|
|
expect(
|
||
|
|
english.instanceUnreachable('Halkyon Learn', 'learn.example.org'),
|
||
|
|
'No instance of Halkyon Learn answers at learn.example.org.',
|
||
|
|
);
|
||
|
|
expect(
|
||
|
|
german.instanceUnreachable('Halkyon Learn', 'learn.example.org'),
|
||
|
|
'Unter learn.example.org antwortet keine Instanz von Halkyon Learn.',
|
||
|
|
);
|
||
|
|
});
|
||
|
|
}
|