From b43b8fabb746795267cb2169faa9737c3cf35b20 Mon Sep 17 00:00:00 2001 From: luojingsong Date: Mon, 20 Jan 2025 20:00:46 +0800 Subject: [PATCH] TDD --- .../unittest/notification_sorting_test.cpp | 2 +- .../notification_subscribe_info_test.cpp | 2 +- .../notification_shell_command_dump_test.cpp | 41 +++++++++++++++---- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/frameworks/ans/test/unittest/notification_sorting_test.cpp b/frameworks/ans/test/unittest/notification_sorting_test.cpp index e28edabc1..d57a2d5dc 100644 --- a/frameworks/ans/test/unittest/notification_sorting_test.cpp +++ b/frameworks/ans/test/unittest/notification_sorting_test.cpp @@ -132,7 +132,7 @@ HWTEST_F(NotificationSortingTest, Dump_00001, Function | SmallTest | Level1) "visiblenessOverride = 30, isDisplayBadge = false, isHiddenNotification = true, " "groupKeyOverride = GroupKeyOverride, slot = NotificationSlot{ id = OTHER, name " "= OTHER, description = , type = 3, level = 1, isBypassDnd = false, visibleness = " - "3, sound = , isLightEnabled = false, lightColor = 0, isVibrate = false, vibration " + "3, sound = file://system/etc/Light.ogg, isLightEnabled = false, lightColor = 0, isVibrate = false, vibration " "= , isShowBadge = true, enabled = true, slotFlags = 0, remindMode = 0 } }"; EXPECT_EQ(rrc->Dump(), ret); } diff --git a/frameworks/ans/test/unittest/notification_subscribe_info_test.cpp b/frameworks/ans/test/unittest/notification_subscribe_info_test.cpp index 10766f6ac..d01af4692 100644 --- a/frameworks/ans/test/unittest/notification_subscribe_info_test.cpp +++ b/frameworks/ans/test/unittest/notification_subscribe_info_test.cpp @@ -167,7 +167,7 @@ HWTEST_F(NotificationSubscribeInfoTest, Dump_00001, Function | SmallTest | Level "appNames = [" + appName + ", ]" + "deviceType = " + deviceType + "userId = " + std::to_string(userId) + - " }"; + "slotTypes = []filterType = 0 }"; EXPECT_EQ(res, rrc->Dump()); } } diff --git a/tools/test/unittest/dump/notification_shell_command_dump_test.cpp b/tools/test/unittest/dump/notification_shell_command_dump_test.cpp index c7e9b2fca..8d0677864 100644 --- a/tools/test/unittest/dump/notification_shell_command_dump_test.cpp +++ b/tools/test/unittest/dump/notification_shell_command_dump_test.cpp @@ -61,11 +61,20 @@ static char g_dumpActiveUser[] = " --receiver, -r dump the info filter by the specified receiver userId\n"; static char g_enableErrorInformation[] = -"error: option 'e' requires a value.\nusage: anm setting []\noptions list:\n" +"error: option 'e' requires a value.\n" +"usage: anm setting []\n" +"options list:\n" " --help, -h help menu\n" -" --recent-count -c set the max count of recent notifications keeping in memory\n --enable-notification" -" -e set notification enabled for the bundle, eg: -e com.example:10100:1\n --set-device-status" -" -d set device status, eg: -d device:1\n"; +" --recent-count -c set the max count of recent notifications keeping in memory\n" +" --enable-notification -e set notification enabled for the bundle, " +"eg: -e com.example:10100:1\n" +" --set-device-status -d set device status, eg: -d device:1\n" +" --collaboration-switch -k set collaboration status, eg: -k wearable:1\n" +" --collaboration-switch-bundle -b set bundle collaboration switch status\n" +" eg: -b wearable:example:10100:1\n" +" --collaboration-switch-slot -o set slot collaboration switch status\n" +" --get-device-status -o set device status\n" +" eg: -o wearable:0:1\n"; static char g_enableBundleNameNull[] = "error: setting information error\n" @@ -73,7 +82,13 @@ static char g_enableBundleNameNull[] = "options list:\n --help, -h help menu\n" " --recent-count -c set the max count of recent notifications keeping in memory\n --enable-notification" " -e set notification enabled for the bundle, eg: -e com.example:10100:1\n --set-device-status" -" -d set device status, eg: -d device:1\n"; +" -d set device status, eg: -d device:1\n" +" --collaboration-switch -k set collaboration status, eg: -k wearable:1\n" +" --collaboration-switch-bundle -b set bundle collaboration switch status\n" +" eg: -b wearable:example:10100:1\n" +" --collaboration-switch-slot -o set slot collaboration switch status\n" +" --get-device-status -o set device status\n" +" eg: -o wearable:0:1\n"; static char g_enableObjectNull[] = "error: object is null\n" @@ -82,7 +97,13 @@ static char g_enableObjectNull[] = "options list:\n --help, -h help menu\n" " --recent-count -c set the max count of recent notifications keeping in memory\n --enable-notification" " -e set notification enabled for the bundle, eg: -e com.example:10100:1\n --set-device-status" -" -d set device status, eg: -d device:1\n"; +" -d set device status, eg: -d device:1\n" +" --collaboration-switch -k set collaboration status, eg: -k wearable:1\n" +" --collaboration-switch-bundle -b set bundle collaboration switch status\n" +" eg: -b wearable:example:10100:1\n" +" --collaboration-switch-slot -o set slot collaboration switch status\n" +" --get-device-status -o set device status\n" +" eg: -o wearable:0:1\n"; static char g_unknownOption[] = "error: unknown option.\n" @@ -102,7 +123,13 @@ static char g_dumpActiveCount[] = " --help, -h help menu\n" " --recent-count -c set the max count of recent notifications keeping in memory\n --enable-notification" " -e set notification enabled for the bundle, eg: -e com.example:10100:1\n --set-device-status" -" -d set device status, eg: -d device:1\n"; +" -d set device status, eg: -d device:1\n" +" --collaboration-switch -k set collaboration status, eg: -k wearable:1\n" +" --collaboration-switch-bundle -b set bundle collaboration switch status\n" +" eg: -b wearable:example:10100:1\n" +" --collaboration-switch-slot -o set slot collaboration switch status\n" +" --get-device-status -o set device status\n" +" eg: -o wearable:0:1\n"; static char g_helpMsg[] = "error: unknown option.\n" -- Gitee