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 <gtest/gtest.h>
17 #include "ability_token_stub.h"
18
19 using namespace testing::ext;
20 namespace OHOS {
21 namespace AAFwk {
22 class AbilityTokenStubTest : public testing::Test {
23 public:
24 static void SetUpTestCase(void);
25 static void TearDownTestCase(void);
26 void SetUp();
27 void TearDown();
28
29 OHOS::sptr<AbilityTokenStub> abilityTokenStub_{ nullptr };
30 OHOS::sptr<AbilityTokenRecipient> abilityTokenRecipient_{ nullptr };
31 };
32
SetUpTestCase(void)33 void AbilityTokenStubTest::SetUpTestCase(void)
34 {}
TearDownTestCase(void)35 void AbilityTokenStubTest::TearDownTestCase(void)
36 {}
TearDown(void)37 void AbilityTokenStubTest::TearDown(void)
38 {}
39
SetUp(void)40 void AbilityTokenStubTest::SetUp(void)
41 {
42 abilityTokenStub_ = new AbilityTokenStub();
43 abilityTokenRecipient_ = new AbilityTokenRecipient();
44 }
45
46 /*
47 * Feature: AbilityTokenStub
48 * Function: AbilityTokenStub
49 * SubFunction: NA
50 * FunctionPoints: NA
51 * EnvConditions:NA
52 * CaseDescription: verify AbilityTokenStub is create success
53 */
54 HWTEST_F(AbilityTokenStubTest, ability_token_stub_operating_001, TestSize.Level1)
55 {
56 EXPECT_NE(abilityTokenStub_, nullptr);
57 }
58
59 /*
60 * Feature: AbilityTokenStub
61 * Function: AbilityTokenRecipient
62 * SubFunction: NA
63 * FunctionPoints: NA
64 * EnvConditions:NA
65 * CaseDescription: verify AbilityTokenRecipient is create success
66 */
67 HWTEST_F(AbilityTokenStubTest, ability_token_stub_operating_002, TestSize.Level1)
68 {
69 EXPECT_NE(abilityTokenRecipient_, nullptr);
70 }
71 } // namespace AAFwk
72 } // namespace OHOS
73