summaryrefslogtreecommitdiffstats
blob: dc6cf0cb88460b914b9f1c87cbff422857d856cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * 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/MIXRegisterNickSerializer.h>
#include <Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h>

using namespace Swift;

TEST(MIXRegisterNickSerializerTest, testSerializeNick) {
    MIXRegisterNickSerializer testling;

    auto mix = std::shared_ptr<MIXRegisterNick>(new MIXRegisterNick());
    mix->setNick(std::string("thirdwitch"));

    std::string expectedResult = "<register xmlns=\"urn:xmpp:mix:0\"><nick>thirdwitch</nick></register>";
    ASSERT_EQ(expectedResult, testling.serialize(mix));
}