Stefan 16b866ccbd chore(CPP): Enhance type safety using phantom types
Important changes:

- Converted the easy to mix strings to named types as phantom types
- Renamed `AccountDto`s to `MultiAccount` to better match the status-go
domain knowledge.
- Renamed MultiAccount to ChatOrWalletAccount to better match its multi
purpose and don't confuse with the MultiAccount domain knowledge.
- Remove libs/CMakeLists.txt

Note: Tried to use the fluent::NamedType but it doesn't work with
nlohmann_json, gave up finding why. Therefore I extracted only
the needed functionality for the simple types we use.

Updates: #6321
2022-07-19 16:56:06 +02:00

38 lines
1.4 KiB
C++

#pragma once
#include "Onboarding/Accounts/AccountsServiceInterface.h"
#include <gmock/gmock.h>
namespace Onboarding = Status::Onboarding;
namespace Status::Testing
{
/*!
* \brief The AccountsServiceMock test class
*
* \todo Consider if this is really neaded for testing controllers
* \todo Move it to mocks subfolder
*/
class AccountsServiceMock final : public Onboarding::AccountsServiceInterface
{
public:
virtual ~AccountsServiceMock() override {};
MOCK_METHOD(bool, init, (const fs::path&), (override));
MOCK_METHOD(std::vector<Onboarding::MultiAccount>, openAndListAccounts, (), (override));
MOCK_METHOD(const std::vector<Onboarding::GeneratedMultiAccount>&, generatedAccounts, (), (const, override));
MOCK_METHOD(bool, setupAccountAndLogin, (const QString&, const QString&, const QString&), (override));
MOCK_METHOD(const Onboarding::MultiAccount&, getLoggedInAccount, (), (const, override));
MOCK_METHOD(const Onboarding::GeneratedMultiAccount&, getImportedAccount, (), (const, override));
MOCK_METHOD(bool, isFirstTimeAccountLogin, (), (const, override));
MOCK_METHOD(bool, setKeyStoreDir, (const QString&), (override));
MOCK_METHOD(QString, login, (Onboarding::MultiAccount, const QString&), (override));
MOCK_METHOD(void, clear, (), (override));
MOCK_METHOD(QString, generateAlias, (const QString&), (override));
MOCK_METHOD(void, deleteMultiAccount, (const Onboarding::MultiAccount&), (override));
};
}