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:
Vicky committed 2026-10-16 09:41:14 +08:00
1 parent 1853e1845c
commit 0e5d550b50
25 files changed
+155 -155

No files matched your search

+3 -3
View File
@@ -6,7 +6,7 @@ import 'package:nontonki/core/data/repositories/catalog_repository.dart';
import 'package:nontonki/core/data/services/catalog_controller.dart';
void main() {
test('空目录与加载失败可区分,重试后恢复', () async {
test('should_distinguish_empty_catalog_from_load_failure_when_retry_succeeds', () async {
final repository = ScriptedCatalogRepository();
final controller = CatalogController(repository);
@@ -30,7 +30,7 @@ void main() {
expect(controller.sections.single.title, '热门推荐');
});
test('详情按需加载:同一部短剧只请求一次', () async {
test('should_request_drama_detail_once_when_it_is_loaded_on_demand', () async {
final repository = ScriptedCatalogRepository();
final controller = CatalogController(repository);
repository.feed = HomeFeed(
@@ -53,7 +53,7 @@ void main() {
expect(controller.dramas.single.episodes, hasLength(2));
});
test('播放票据:可播放写入地址,锁定集保持无地址', () async {
test('should_write_play_url_for_free_episode_and_keep_locked_episode_empty_when_ticket_is_issued', () async {
final repository = ScriptedCatalogRepository();
final controller = CatalogController(repository);
repository.tickets['10'] = const PlayTicket(
+3 -3
View File
@@ -2,7 +2,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:nontonki/core/data/models/drama.dart';
void main() {
test('a list card carries one playable preview and the total count', () {
test('should_carry_one_preview_and_total_count_when_list_card_is_parsed', () {
final drama = Drama.fromCardJson(const {
'id': 5,
'title': '闪婚后',
@@ -29,7 +29,7 @@ void main() {
expect(drama.isHot, isTrue);
});
test('a list card without a playable preview has no episodes', () {
test('should_have_no_episodes_when_list_card_has_no_playable_preview', () {
final drama = Drama.fromCardJson(const {
'id': 6,
'title': '替嫁新娘',
@@ -40,7 +40,7 @@ void main() {
expect(drama.episodeCount, 12);
});
test('a detail response counts the episodes it ships', () {
test('should_count_shipped_episodes_when_detail_response_is_parsed', () {
final drama = Drama.fromDetailJson(const {
'id': 5,
'title': '闪婚后',