FileManagerMock.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef FILEMANAGERMOCK_H
  2. #define FILEMANAGERMOCK_H
  3. #include "../include/FileManager.h"
  4. #include <gmock/gmock.h>
  5. /**
  6. * @class FileManagerMock
  7. *
  8. * Gmock stub class for FileManager so you can test without writing and reading actual files.
  9. */
  10. class FileManagerMock : public FileManager {
  11. public:
  12. MOCK_METHOD((std::pair<bool, int>), openGetFile, (const std::string &filename), (override));
  13. MOCK_METHOD(bool, openPutFile, (const std::string &filename), (override));
  14. MOCK_METHOD(bool, isDownloading, (), (override));
  15. MOCK_METHOD(bool, isUploading, (), (override));
  16. MOCK_METHOD(void, cancelPut, (), (override));
  17. MOCK_METHOD(std::string, getGetBaseFileName, (), (override));
  18. MOCK_METHOD(std::string, getPutBaseFileName, (), (override));
  19. MOCK_METHOD(void, writePut, (const std::vector<char> &data), (override));
  20. MOCK_METHOD(std::vector<char>, readGet, (), (override));
  21. MOCK_METHOD(int, openList, (), (override));
  22. MOCK_METHOD(int, getRemainingListChunks, (), (override));
  23. MOCK_METHOD(int, getListSize, (), (override));
  24. MOCK_METHOD(std::vector<std::string>, getNextChunkFromList, (), (override));
  25. MOCK_METHOD(FileManager::Error, deleteFile, (const std::string &filename), (override));
  26. MOCK_METHOD((std::pair<std::vector<char>, FileManager::Error>), getBytesFromFile, (const std::string &filename, int numOfBytes), (override));
  27. };
  28. #endif