mirror of
https://gitee.com/jiuyilian/embedded-framework.git
synced 2025-10-24 18:20:15 -04:00
63 lines
2.7 KiB
C++
63 lines
2.7 KiB
C++
/*
|
|
* Copyright (c) 2023 Fancy Code.
|
|
* 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 APP_MONITOR_MOCK_H
|
|
#define APP_MONITOR_MOCK_H
|
|
#include "GtestUsing.h"
|
|
#include "IAppManager.h"
|
|
class AppMonitorTrace
|
|
{
|
|
public:
|
|
AppMonitorTrace() = default;
|
|
virtual ~AppMonitorTrace() = default;
|
|
|
|
protected:
|
|
virtual StatusCode GetProductInfoTrace(AppGetProductInfo ¶m);
|
|
virtual StatusCode GetDeviceAttrTrace(AppGetDeviceAttr ¶m);
|
|
virtual StatusCode GetMediaInfoTrace(AppGetMeidaInfo ¶m);
|
|
virtual StatusCode GetSdCardInfoTrace(AppGetSdCardInfo ¶m);
|
|
virtual StatusCode GetBatteryInfoTrace(AppGetBatteryInfo ¶m);
|
|
virtual StatusCode SetDateTimeTrace(AppSetDateTime ¶m);
|
|
virtual StatusCode SetTimeZoneTrace(const unsigned int &zone);
|
|
virtual StatusCode UploadFileTrace(AppUploadFile ¶m);
|
|
};
|
|
class AppMonitorTest : public VAppMonitor, virtual public AppMonitorTrace
|
|
{
|
|
public:
|
|
AppMonitorTest() = default;
|
|
virtual ~AppMonitorTest() = default;
|
|
StatusCode GetProductInfo(AppGetProductInfo ¶m) override;
|
|
StatusCode GetDeviceAttr(AppGetDeviceAttr ¶m) override;
|
|
StatusCode GetMediaInfo(AppGetMeidaInfo ¶m) override;
|
|
StatusCode GetSdCardInfo(AppGetSdCardInfo ¶m) override;
|
|
StatusCode GetBatteryInfo(AppGetBatteryInfo ¶m) override;
|
|
StatusCode SetDateTime(AppSetDateTime ¶m) override;
|
|
StatusCode SetTimeZone(const unsigned int &zone) override;
|
|
StatusCode UploadFile(AppUploadFile ¶m) override;
|
|
};
|
|
class AppMonitorMock : virtual public AppMonitorTrace
|
|
{
|
|
public:
|
|
AppMonitorMock() = default;
|
|
virtual ~AppMonitorMock() = default;
|
|
MOCK_METHOD1(GetProductInfoTrace, StatusCode(AppGetProductInfo &));
|
|
MOCK_METHOD1(GetDeviceAttrTrace, StatusCode(AppGetDeviceAttr &));
|
|
MOCK_METHOD1(GetMediaInfoTrace, StatusCode(AppGetMeidaInfo &));
|
|
MOCK_METHOD1(GetSdCardInfoTrace, StatusCode(AppGetSdCardInfo &));
|
|
MOCK_METHOD1(GetBatteryInfoTrace, StatusCode(AppGetBatteryInfo &));
|
|
MOCK_METHOD1(SetDateTimeTrace, StatusCode(AppSetDateTime &));
|
|
MOCK_METHOD1(SetTimeZoneTrace, StatusCode(const unsigned int &));
|
|
MOCK_METHOD1(UploadFileTrace, StatusCode(AppUploadFile &));
|
|
};
|
|
#endif |