diff --git a/frameworks/ans/test/unittest/notification_flags_test.cpp b/frameworks/ans/test/unittest/notification_flags_test.cpp index ebcb1cc18d836fcaebb42f0a8669eee446fb6e9a..ac79bc316fe636f68e1ecb8a9795b411e4f37b0e 100644 --- a/frameworks/ans/test/unittest/notification_flags_test.cpp +++ b/frameworks/ans/test/unittest/notification_flags_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -60,6 +60,71 @@ HWTEST_F(NotificationFlagsTest, SetVibrationEnabled_00001, Function | SmallTest EXPECT_EQ(rrc->IsVibrationEnabled(), vibrationEnabled); } +/** + * @tc.name: GetReminderFlags_00001 + * @tc.desc: Test GetReminderFlags parameters. + * @tc.type: FUNC + * @tc.require: issue I9AQ3T + */ +HWTEST_F(NotificationFlagsTest, GetReminderFlags_00001, Function | SmallTest | Level1) +{ + auto rrc = std::make_shared(); + rrc->SetLockScreenVisblenessEnabled(true); + EXPECT_NE(rrc->GetReminderFlags(), 0); +} + +/** + * @tc.name: SetLockScreenVisblenessEnabled_00001 + * @tc.desc: Test SetLockScreenVisblenessEnabled parameters. + * @tc.type: FUNC + * @tc.require: issue I9AQ3T + */ +HWTEST_F(NotificationFlagsTest, SetLockScreenVisblenessEnabled_00001, Function | SmallTest | Level1) +{ + auto rrc = std::make_shared(); + rrc->SetLockScreenVisblenessEnabled(true); + EXPECT_EQ(rrc->IsLockScreenVisblenessEnabled(), true); +} + +/** + * @tc.name: SetBannerEnabled_00001 + * @tc.desc: Test SetBannerEnabled parameters. + * @tc.type: FUNC + * @tc.require: issue I9AQ3T + */ +HWTEST_F(NotificationFlagsTest, SetBannerEnabled_00001, Function | SmallTest | Level1) +{ + auto rrc = std::make_shared(); + rrc->SetBannerEnabled(true); + EXPECT_EQ(rrc->IsBannerEnabled(), true); +} + +/** + * @tc.name: SetLightScreenEnabled_00001 + * @tc.desc: Test SetLightScreenEnabled parameters. + * @tc.type: FUNC + * @tc.require: issue I9AQ3T + */ +HWTEST_F(NotificationFlagsTest, SetLightScreenEnabled_00001, Function | SmallTest | Level1) +{ + auto rrc = std::make_shared(); + rrc->SetLightScreenEnabled(true); + EXPECT_EQ(rrc->IsLightScreenEnabled(), true); +} + +/** + * @tc.name: SetStatusIconEnabled_00001 + * @tc.desc: Test SetStatusIconEnabled parameters. + * @tc.type: FUNC + * @tc.require: issue I9AQ3T + */ +HWTEST_F(NotificationFlagsTest, SetStatusIconEnabled_00001, Function | SmallTest | Level1) +{ + auto rrc = std::make_shared(); + rrc->SetStatusIconEnabled(true); + EXPECT_EQ(rrc->IsStatusIconEnabled(), true); +} + /** * @tc.name: Dump_00001 * @tc.desc: Test Dump parameters. diff --git a/frameworks/ans/test/unittest/notification_request_test.cpp b/frameworks/ans/test/unittest/notification_request_test.cpp index 00e841ceda18d4a00817f78ba1271400c73dea92..f38cd2bc10effcf6a3c5afece7861db119f98304 100644 --- a/frameworks/ans/test/unittest/notification_request_test.cpp +++ b/frameworks/ans/test/unittest/notification_request_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -961,6 +961,21 @@ HWTEST_F(NotificationRequestTest, GetNotificationRequestKey_0002, Level1) EXPECT_EQ(key, expectKey); } +/** + * @tc.name: SetNotificationControlFlags_0001 + * @tc.desc: Set notification control flags. + * @tc.type: FUNC + * @tc.require: issue I9AQ3T + */ +HWTEST_F(NotificationRequestTest, SetNotificationControlFlags_0001, Level1) +{ + int32_t myNotificationId = 10; + NotificationRequest notificationRequest(myNotificationId); + notificationRequest.SetNotificationControlFlags(1); + uint32_t flags = notificationRequest.GetNotificationControlFlags(); + EXPECT_EQ(flags, 1); +} + inline std::shared_ptr TestMakePixelMap(int32_t width, int32_t height) { const int32_t PIXEL_BYTES = 4;