test(client): 用例名统一为 should_<期望>_when_<条件>(155/155)
为什么:红线第 8 条门禁立即生效,要求 Flutter 测试命名合规;此前 155 条用例名是英文自然语言 或中文描述,合规数 0/155,属存量欠账,按"先补齐再上新功能"在本批处理。 - 25 个测试文件、155 条用例改名,按「文件 + 旧名」精确定位,每条断言命中恰好 1 次才替换 - 只改名字字面量:改动行 155 删 + 155 增,无一行不含字符串字面量(断言与用例体零改动) - 门禁:dart analyze lib test = No issues found;flutter test = 155 全过
This commit is contained in:
1 parent
1853e1845c
commit
0e5d550b50
25 files changed
+155
-155
No files matched your search
@@ -11,7 +11,7 @@ void main() {
|
||||
InMemorySharedPreferencesAsync.empty();
|
||||
});
|
||||
|
||||
test('no stored choice keeps the device locale', () async {
|
||||
test('should_keep_device_locale_when_no_choice_is_stored', () async {
|
||||
final controller = LocaleController();
|
||||
var notifications = 0;
|
||||
controller.addListener(() => notifications++);
|
||||
@@ -22,7 +22,7 @@ void main() {
|
||||
expect(notifications, 1);
|
||||
});
|
||||
|
||||
test('a chosen language survives a restart', () async {
|
||||
test('should_restore_chosen_language_when_app_restarts', () async {
|
||||
final first = LocaleController();
|
||||
await first.select('zh');
|
||||
expect(first.locale, const Locale('zh'));
|
||||
@@ -32,7 +32,7 @@ void main() {
|
||||
expect(reopened.locale, const Locale('zh'));
|
||||
});
|
||||
|
||||
test('selecting english clears a stored chinese preference', () async {
|
||||
test('should_clear_stored_chinese_preference_when_english_is_selected', () async {
|
||||
await LocaleController().select('zh');
|
||||
|
||||
final reopened = LocaleController();
|
||||
@@ -44,7 +44,7 @@ void main() {
|
||||
expect(third.locale, const Locale('en'));
|
||||
});
|
||||
|
||||
test('an unsupported code clears the locale instead of throwing', () async {
|
||||
test('should_clear_locale_when_code_is_unsupported', () async {
|
||||
final controller = LocaleController();
|
||||
await controller.select('zh');
|
||||
expect(controller.locale, const Locale('zh'));
|
||||
@@ -54,7 +54,7 @@ void main() {
|
||||
expect(controller.locale, isNull);
|
||||
});
|
||||
|
||||
test('an unsupported stored code resolves to the device locale', () async {
|
||||
test('should_resolve_to_device_locale_when_stored_code_is_unsupported', () async {
|
||||
await SharedPreferencesAsync().setString('ui.locale', 'fr');
|
||||
|
||||
final controller = LocaleController();
|
||||
@@ -63,7 +63,7 @@ void main() {
|
||||
expect(controller.locale, isNull);
|
||||
});
|
||||
|
||||
test('a broken preference store never breaks load or select', () async {
|
||||
test('should_survive_load_and_select_when_preference_store_is_broken', () async {
|
||||
SharedPreferencesAsyncPlatform.instance = _BrokenPreferences();
|
||||
final controller = LocaleController();
|
||||
|
||||
|
||||
Reference in new issue
Block a user