summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/UnitTest/MIXRegisterNickParserTest.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/MIXRegisterNickParserTest.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MIXRegisterNickParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MIXRegisterNickParserTest.cpp
new file mode 100644
index 0000000..d0539fd
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/UnitTest/MIXRegisterNickParserTest.cpp
@@ -0,0 +1,23 @@
+/*
+ * 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/Elements/MIXRegisterNick.h>
+#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
+
+using namespace Swift;
+
+TEST(MIXRegisterNickParserTest, WithNick) {
+ PayloadsParserTester parser;
+ ASSERT_TRUE(parser.parse(
+ "<register xmlns=\"urn:xmpp:mix:0\"> <nick>thirdwitch</nick> </register>"
+ ));
+
+ auto payload = parser.getPayload<MIXRegisterNick>();
+ ASSERT_TRUE(payload);
+ ASSERT_EQ("thirdwitch", payload->getNick());
+}