summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Avatars/UnitTest')
-rw-r--r--Swiften/Avatars/UnitTest/MockAvatarManager.cpp26
-rw-r--r--Swiften/Avatars/UnitTest/MockAvatarManager.h17
2 files changed, 43 insertions, 0 deletions
diff --git a/Swiften/Avatars/UnitTest/MockAvatarManager.cpp b/Swiften/Avatars/UnitTest/MockAvatarManager.cpp
new file mode 100644
index 0000000..2d3d48a
--- /dev/null
+++ b/Swiften/Avatars/UnitTest/MockAvatarManager.cpp
@@ -0,0 +1,26 @@
+#include "Swiften/Avatars/UnitTest/MockAvatarManager.h"
+
+namespace Swift {
+
+MockAvatarManager::MockAvatarManager() {
+
+}
+
+MockAvatarManager::~MockAvatarManager() {
+
+}
+
+String MockAvatarManager::getAvatarHash(const JID& jid) const {
+ return jid.toBare();
+}
+
+boost::filesystem::path MockAvatarManager::getAvatarPath(const JID& jid) const {
+ return jid.getResource().getUTF8String();
+}
+
+void MockAvatarManager::setAvatar(const JID&, const ByteArray&) {
+
+}
+
+}
+
diff --git a/Swiften/Avatars/UnitTest/MockAvatarManager.h b/Swiften/Avatars/UnitTest/MockAvatarManager.h
new file mode 100644
index 0000000..416d921
--- /dev/null
+++ b/Swiften/Avatars/UnitTest/MockAvatarManager.h
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "Swiften/Avatars/AvatarManager.h"
+#include "Swiften/Client/DummyStanzaChannel.h"
+
+namespace Swift {
+ class MockAvatarManager : public AvatarManager {
+ public:
+ MockAvatarManager();
+ virtual ~MockAvatarManager();
+ virtual String getAvatarHash(const JID&) const;
+ virtual boost::filesystem::path getAvatarPath(const JID&) const;
+ virtual void setAvatar(const JID&, const ByteArray& avatar);
+ private:
+ DummyStanzaChannel channel_;
+ };
+}