Add input completion test suite (#4644)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Daniel Sage
2023-05-21 06:10:49 -04:00
committed by GitHub
parent e9f300b765
commit 51f2c4d1c0
24 changed files with 514 additions and 63 deletions
+18 -4
View File
@@ -23,7 +23,21 @@ class TwitchChannel;
class BttvLiveUpdates;
class SeventvEventAPI;
class TwitchIrcServer final : public AbstractIrcServer, public Singleton
class ITwitchIrcServer
{
public:
virtual ~ITwitchIrcServer() = default;
virtual const BttvEmotes &getBttvEmotes() const = 0;
virtual const FfzEmotes &getFfzEmotes() const = 0;
virtual const SeventvEmotes &getSeventvEmotes() const = 0;
// Update this interface with TwitchIrcServer methods as needed
};
class TwitchIrcServer final : public AbstractIrcServer,
public Singleton,
public ITwitchIrcServer
{
public:
TwitchIrcServer();
@@ -70,9 +84,9 @@ public:
std::unique_ptr<BttvLiveUpdates> bttvLiveUpdates;
std::unique_ptr<SeventvEventAPI> seventvEventAPI;
const BttvEmotes &getBttvEmotes() const;
const FfzEmotes &getFfzEmotes() const;
const SeventvEmotes &getSeventvEmotes() const;
const BttvEmotes &getBttvEmotes() const override;
const FfzEmotes &getFfzEmotes() const override;
const SeventvEmotes &getSeventvEmotes() const override;
protected:
virtual void initializeConnection(IrcConnection *connection,
+1 -1
View File
@@ -12,7 +12,7 @@ If you're adding support for a new endpoint, these are the things you should kno
1. Add a virtual function in the `IHelix` class. Naming should reflect the API name as best as possible.
1. Override the virtual function in the `Helix` class.
1. Mock the function in the `MockHelix` class in the `tests/src/HighlightController.cpp` file.
1. Mock the function in the `mock::Helix` class in the `mocks/include/mocks/Helix.hpp` file.
1. (Optional) Make a new error enum for the failure callback.
For a simple example, see the `updateUserChatColor` function and its error enum `HelixUpdateUserChatColorError`.