1 /*
2  * Copyright (c) 2021 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 
16 #include <functional>
17 #include <gtest/gtest.h>
18 #define private public
19 #define protected public
20 #include "advanced_notification_service_ability.h"
21 
22 using namespace testing::ext;
23 
24 namespace OHOS {
25 namespace Notification {
26 class AdvancedNotificationServiceAbilityTest : public testing::Test {
27 public:
SetUpTestCase()28     static void SetUpTestCase() {};
TearDownTestCase()29     static void TearDownTestCase() {};
SetUp()30     void SetUp() {};
TearDown()31     void TearDown() {};
32 };
33 
34 /**
35  * @tc.number    : AdvancedNotificationServiceAbilityTest_00100
36  * @tc.name      : ANS_AdvancedNotificationServiceAbility_0100
37  * @tc.desc      : Structure AdvancedNotificationServiceAbility with systemAbilityId and runOnCreate
38  */
39 HWTEST_F(
40     AdvancedNotificationServiceAbilityTest, AdvancedNotificationServiceAbilityTest_00100, Function | SmallTest | Level1)
41 {
42     int32_t systemAbilityId = 1;
43     bool runOnCreate = true;
44     AdvancedNotificationServiceAbility(systemAbilityId, runOnCreate);
45 }
46 
47 /**
48  * @tc.number    : AdvancedNotificationServiceAbilityTest_00200
49  * @tc.name      : ANS_AdvancedNotificationServiceAbility_0200
50  * @tc.desc      : Structure AdvancedNotificationServiceAbility with systemAbilityId and runOnCreate
51  */
52 HWTEST_F(
53     AdvancedNotificationServiceAbilityTest, AdvancedNotificationServiceAbilityTest_00200, Function | SmallTest | Level1)
54 {
55     int32_t systemAbilityId = 1;
56     bool runOnCreate = true;
57     AdvancedNotificationServiceAbility test(systemAbilityId, runOnCreate);
58     test.OnStart();
59 }
60 
61 /**
62  * @tc.number    : AdvancedNotificationServiceAbilityTest_00300
63  * @tc.name      : ANS_AdvancedNotificationServiceAbility_0300
64  * @tc.desc      : Structure AdvancedNotificationServiceAbility with systemAbilityId and runOnCreate
65  */
66 HWTEST_F(
67     AdvancedNotificationServiceAbilityTest, AdvancedNotificationServiceAbilityTest_00300, Function | SmallTest | Level1)
68 {
69     int32_t systemAbilityId = 1;
70     bool runOnCreate = true;
71     AdvancedNotificationServiceAbility test(systemAbilityId, runOnCreate);
72     test.OnStop();
73     test.OnStart();
74 }
75 }  // namespace Notification
76 }  // namespace OHOS
77