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
@@ -32,7 +32,7 @@ Drama _drama(String id, {List<int> numbers = const [1, 2, 3]}) => Drama(
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
test('the constructor keeps the requested section and reads episode one', () async {
|
||||
test('should_keep_requested_section_and_read_episode_one_when_constructed', () async {
|
||||
final history = FakeWatchHistory()..saved = const Duration(seconds: 7);
|
||||
final logic = MineLogic(
|
||||
history: history,
|
||||
@@ -47,7 +47,7 @@ void main() {
|
||||
logic.dispose();
|
||||
});
|
||||
|
||||
test('a list card without episodes resumes from the last watch', () async {
|
||||
test('should_resume_from_last_watch_when_list_card_has_no_episodes', () async {
|
||||
final history = FakeWatchHistory()
|
||||
..saved = const Duration(seconds: 7)
|
||||
..lastEpisode = 'signal-3';
|
||||
@@ -62,7 +62,7 @@ void main() {
|
||||
logic.dispose();
|
||||
});
|
||||
|
||||
test('section and filter selections notify', () {
|
||||
test('should_notify_when_section_and_filter_are_selected', () {
|
||||
final logic = MineLogic(
|
||||
history: FakeWatchHistory(),
|
||||
drama: _drama('s'),
|
||||
@@ -81,7 +81,7 @@ void main() {
|
||||
logic.dispose();
|
||||
});
|
||||
|
||||
test('syncPage only adopts a drama while the page is active', () {
|
||||
test('should_adopt_drama_only_when_page_is_active', () {
|
||||
final history = FakeWatchHistory();
|
||||
final logic = MineLogic(
|
||||
history: history,
|
||||
@@ -125,7 +125,7 @@ void main() {
|
||||
logic.dispose();
|
||||
});
|
||||
|
||||
test('a section request resets the section even while the page is inactive', () {
|
||||
test('should_reset_section_when_section_request_arrives_while_page_is_inactive', () {
|
||||
final logic = MineLogic(
|
||||
history: FakeWatchHistory(),
|
||||
drama: _drama('s'),
|
||||
@@ -146,7 +146,7 @@ void main() {
|
||||
logic.dispose();
|
||||
});
|
||||
|
||||
testWidgets('act returns the choice for a page and forwards it when embedded', (
|
||||
testWidgets('should_return_choice_and_forward_it_when_act_runs_embedded', (
|
||||
tester,
|
||||
) async {
|
||||
final logic = MineLogic(
|
||||
@@ -197,7 +197,7 @@ void main() {
|
||||
logic.dispose();
|
||||
});
|
||||
|
||||
testWidgets('the language sheet switches the app locale', (tester) async {
|
||||
testWidgets('should_switch_app_locale_when_language_sheet_is_used', (tester) async {
|
||||
SharedPreferencesAsyncPlatform.instance =
|
||||
InMemorySharedPreferencesAsync.empty();
|
||||
final locale = LocaleController();
|
||||
@@ -239,7 +239,7 @@ void main() {
|
||||
logic.dispose();
|
||||
});
|
||||
|
||||
test('notify after dispose is a no-op', () {
|
||||
test('should_do_nothing_when_notifying_after_dispose', () {
|
||||
final logic = MineLogic(
|
||||
history: FakeWatchHistory(),
|
||||
drama: _drama('s'),
|
||||
|
||||
Reference in new issue
Block a user