• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #include <gtest/gtest.h>
16 
17 #include "notification_app_privileges.h"
18 
19 using namespace testing::ext;
20 namespace OHOS {
21 namespace Notification {
22 class NotificationAppPrivilegesTest : public testing::Test {
23 public:
SetUpTestCase()24     static void SetUpTestCase() {};
TearDownTestCase()25     static void TearDownTestCase() {};
SetUp()26     void SetUp() {};
TearDown()27     void TearDown() {};
28 };
29 
30 /**
31  * @tc.name      : NotificationAppPrivileges_00100
32  * @tc.number    :
33  * @tc.desc      : Test constructure.
34  */
35 HWTEST_F(NotificationAppPrivilegesTest, NotificationAppPrivileges_00100, Function | SmallTest | Level1)
36 {
37     NotificationAppPrivileges appPrivileges("1");
38     EXPECT_EQ(appPrivileges.IsLiveViewEnabled(), true);
39     EXPECT_EQ(appPrivileges.IsBannerEnabled(), false);
40     EXPECT_EQ(appPrivileges.IsReminderEnabled(), false);
41 }
42 
43 
44 /**
45  * @tc.name      : NotificationAppPrivileges_00100
46  * @tc.number    :
47  * @tc.desc      : Test constructure.
48  */
49 HWTEST_F(NotificationAppPrivilegesTest, NotificationAppPrivileges_00200, Function | SmallTest | Level1)
50 {
51     NotificationAppPrivileges appPrivileges("11");
52     EXPECT_EQ(appPrivileges.IsLiveViewEnabled(), true);
53     EXPECT_EQ(appPrivileges.IsBannerEnabled(), true);
54     EXPECT_EQ(appPrivileges.IsReminderEnabled(), false);
55 }
56 
57 /**
58  * @tc.name      : NotificationAppPrivileges_00100
59  * @tc.number    :
60  * @tc.desc      : Test constructure.
61  */
62 HWTEST_F(NotificationAppPrivilegesTest, NotificationAppPrivileges_00300, Function | SmallTest | Level1)
63 {
64     NotificationAppPrivileges appPrivileges("111");
65     EXPECT_EQ(appPrivileges.IsLiveViewEnabled(), true);
66     EXPECT_EQ(appPrivileges.IsBannerEnabled(), true);
67     EXPECT_EQ(appPrivileges.IsReminderEnabled(), true);
68 }
69 
70 /**
71  * @tc.name      : NotificationAppPrivileges_00100
72  * @tc.number    :
73  * @tc.desc      : Test constructure.
74  */
75 HWTEST_F(NotificationAppPrivilegesTest, NotificationAppPrivileges_00400, Function | SmallTest | Level1)
76 {
77     NotificationAppPrivileges appPrivileges("001");
78     EXPECT_EQ(appPrivileges.IsLiveViewEnabled(), false);
79     EXPECT_EQ(appPrivileges.IsBannerEnabled(), false);
80     EXPECT_EQ(appPrivileges.IsReminderEnabled(), true);
81 }
82 } // namespace Notification
83 } // namespace OHOS
84