• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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 "n_class_test.h"
17 #include "n_class.h"
18 
19 using namespace std;
20 using namespace OHOS;
21 using namespace testing::ext;
22 
23 namespace OHOS {
24 namespace Media {
SetUpTestCase(void)25 void FilemangementLibnTest::SetUpTestCase(void) {}
26 
TearDownTestCase(void)27 void FilemangementLibnTest::TearDownTestCase(void) {}
28 
SetUp()29 void FilemangementLibnTest::SetUp() {}
30 
TearDown()31 void FilemangementLibnTest::TearDown() {}
32 
33 HWTEST_F(FilemangementLibnTest, NClassTest_DefineClass_001, TestSize.Level1)
34 {
35     string className = "TestClassAB";
36     napi_callback vlaue = nullptr;
37     vector<napi_property_descriptor> props = {};
38     bool succ = false;
39     napi_value classValue = nullptr;
40     napi_env envTest = nullptr;
41     tie(succ, classValue) = FileManagement::LibN::NClass::DefineClass(envTest, className, vlaue, std::move(props));
42     EXPECT_EQ(succ, false);
43     EXPECT_EQ((classValue == nullptr), true);
44 }
45 
46 HWTEST_F(FilemangementLibnTest, NClassTest_SaveClass_001, TestSize.Level1)
47 {
48     string className = "TestClassAB";
49     bool succ = false;
50     napi_value classValue = nullptr;
51     napi_env envTest = nullptr;
52     succ = FileManagement::LibN::NClass::SaveClass(envTest, className, classValue);
53     EXPECT_EQ(succ, false);
54 }
55 } // namespace Media
56 } // namespace OHOS