summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/UnitTest/MIXLeaveSerializerTest.cpp')
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/MIXLeaveSerializerTest.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MIXLeaveSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MIXLeaveSerializerTest.cpp
new file mode 100644
index 0000000..d9537a8
--- /dev/null
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MIXLeaveSerializerTest.cpp
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include <gtest/gtest.h>
+
+#include <Swiften/Serializer/PayloadSerializers/MIXLeaveSerializer.h>
+
+using namespace Swift;
+
+TEST(MIXLeaveSerializerTest, XEP0369_Example33) {
+ MIXLeaveSerializer testling;
+
+ auto leave = std::shared_ptr<MIXLeave>(new MIXLeave());
+ leave->setChannel(JID("coven@mix.shakespeare.example"));
+
+ std::string expectedResult = "<leave channel=\"coven@mix.shakespeare.example\" xmlns=\"urn:xmpp:mix:0\"/>";
+ ASSERT_EQ(expectedResult, testling.serialize(leave));
+}
+
+TEST(MIXLeaveSerializerTest, XEP0369_Example34) {
+ MIXLeaveSerializer testling;
+
+ auto leave = std::shared_ptr<MIXLeave>(new MIXLeave());
+
+ std::string expectedResult = "<leave xmlns=\"urn:xmpp:mix:0\"/>";
+ ASSERT_EQ(expectedResult, testling.serialize(leave));
+}