Test filters context map & message builder (#4886)

This commit is contained in:
pajlada
2023-10-13 17:41:23 +02:00
committed by GitHub
parent b85d666b32
commit 9f23c8562a
17 changed files with 345 additions and 70 deletions
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#include "common/Channel.hpp"
namespace chatterino::mock {
class MockChannel : public Channel
{
public:
MockChannel(const QString &name)
: Channel(name, Channel::Type::Twitch)
{
}
};
} // namespace chatterino::mock
+6
View File
@@ -74,6 +74,12 @@ public:
return nullptr;
}
SeventvBadges *getSeventvBadges() override
{
assert(!"getSeventvBadges was called without being initialized");
return nullptr;
}
IUserDataController *getUserData() override
{
return nullptr;
+46
View File
@@ -0,0 +1,46 @@
#pragma once
#include "mocks/Channel.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
namespace chatterino::mock {
class MockTwitchIrcServer : public ITwitchIrcServer
{
public:
MockTwitchIrcServer()
: watchingChannelInner(
std::shared_ptr<Channel>(new MockChannel("testaccount_420")))
, watchingChannel(this->watchingChannelInner,
Channel::Type::TwitchWatching)
{
}
const BttvEmotes &getBttvEmotes() const override
{
return this->bttv;
}
const FfzEmotes &getFfzEmotes() const override
{
return this->ffz;
}
const SeventvEmotes &getSeventvEmotes() const override
{
return this->seventv;
}
const IndirectChannel &getWatchingChannel() const override
{
return this->watchingChannel;
}
BttvEmotes bttv;
FfzEmotes ffz;
SeventvEmotes seventv;
ChannelPtr watchingChannelInner;
IndirectChannel watchingChannel;
};
} // namespace chatterino::mock