/* * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TEST_UNITTEST_MOCK_NATIVE_REFERENCE_MOCK_H #define TEST_UNITTEST_MOCK_NATIVE_REFERENCE_MOCK_H #include #include "native_engine/native_reference.h" namespace OHOS { namespace FileAccessFwk { class NativeReferenceMock : public NativeReference { public: NativeReferenceMock() = default; virtual ~NativeReferenceMock() = default; MOCK_METHOD0(Ref, uint32_t()); MOCK_METHOD0(Unref, uint32_t()); MOCK_METHOD0(Get, napi_value()); MOCK_METHOD0(GetData, void*()); virtual operator napi_value() override { return reinterpret_cast(this); } MOCK_METHOD0(SetDeleteSelf, void()); MOCK_METHOD0(GetRefCount, uint32_t()); MOCK_METHOD0(GetFinalRun, bool()); MOCK_METHOD0(GetNapiValue, napi_value()); }; } // End of namespace FileAccessFwk } // End of namespace OHOS #endif // TEST_UNITTEST_MOCK_NATIVE_REFERENCE_MOCK_H