diff --git a/frameworks/ans/test/unittest/BUILD.gn b/frameworks/ans/test/unittest/BUILD.gn index 80f902f98e0c8e1fcdc57b34cc1bc5b6fe17c732..9e93dde4af23a56bea6372500d954bd6538d9457 100644 --- a/frameworks/ans/test/unittest/BUILD.gn +++ b/frameworks/ans/test/unittest/BUILD.gn @@ -39,6 +39,7 @@ ohos_unittest("ans_reminder_unit_test") { "${frameworks_module_ans_path}/test/unittest/notification_do_not_disturb_date_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_flags_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_helper_test.cpp", + "${frameworks_module_ans_path}/test/unittest/notification_local_live_view_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_long_text_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_media_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_multiline_content_test.cpp", diff --git a/frameworks/ans/test/unittest/notification_local_live_view_content_test.cpp b/frameworks/ans/test/unittest/notification_local_live_view_content_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bd0219e39f1884590735768ad973fbe46dc31ffa --- /dev/null +++ b/frameworks/ans/test/unittest/notification_local_live_view_content_test.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2022 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "notification_local_live_view_content.h" + +using namespace testing::ext; +namespace OHOS { +namespace Notification { +class NotificationLocalLiveViewContentTest : public testing::Test { +public: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + void SetUp() {} + void TearDown() {} +}; + +/** + * @tc.name: SetTypeCode_00001 + * @tc.desc: Test SetTypeCode parameters. + * @tc.type: FUNC + * @tc.require: issue + */ +HWTEST_F(NotificationLocalLiveViewContentTest, SetTypeCode_00001, Function | SmallTest | Level1) +{ + int32_t typeCode = 1; + auto rrc = std::make_shared(); + rrc->SetType(typeCode); + EXPECT_EQ(rrc->GetType(), typeCode); +} +} +}