• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 #include <thread>
17 
18 #include "cardEmulation.h"
19 #include "nfc_sdk_common.h"
20 
21 namespace OHOS {
22 namespace NFC {
23 namespace TEST {
24 using namespace testing::ext;
25 using namespace OHOS::NFC::KITS;
26 class CardemulationTest : public testing::Test {
27 public:
28     static void SetUpTestCase();
29     static void TearDownTestCase();
30     void SetUp();
31     void TearDown();
32 };
33 
SetUpTestCase()34 void CardemulationTest::SetUpTestCase()
35 {
36     std::cout << " SetUpTestCase CardemulationTest." << std::endl;
37 }
38 
TearDownTestCase()39 void CardemulationTest::TearDownTestCase()
40 {
41     std::cout << " TearDownTestCase CardemulationTest." << std::endl;
42 }
43 
SetUp()44 void CardemulationTest::SetUp() {}
45 
TearDown()46 void CardemulationTest::TearDown() {}
47 
48 /**
49  * @tc.name: IsSupporte001
50  * @tc.desc: Test CardemulationTest IsSupporte.
51  * @tc.type: FUNC
52  */
53 HWTEST_F(CardemulationTest, IsSupported001, TestSize.Level1)
54 {
55     bool issupport = false;
56     CardEmulation cardemulation = CardEmulation::GetInstance();
57 
58     // Supports FeatureType { HCE = 0, UICC = 1, ESE = 2 } type card emulation
59     issupport = cardemulation.IsSupported(FeatureType::UICC);
60     ASSERT_TRUE(issupport == true);
61 }
62 }
63 }
64 }
65