summaryrefslogtreecommitdiffstats
blob: 162235482fe70f76dad5ba70b9d71caab1122098 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * 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/ClientStateSerializer.h>

using namespace Swift;

TEST(ClientStateSerializerTest, testSerialize_ActiveState) {
    ClientStateSerializer testling;
    std::shared_ptr<ClientState> priority(new ClientState(ClientState::ClientStateType::Active));

    ASSERT_EQ(std::string("<active xmlns=\"urn:xmpp:csi:0\"/>"), testling.serialize(priority));
}

TEST(ClientStateSerializerTest, testSerialize_InacativeState) {
    ClientStateSerializer testling;
    std::shared_ptr<ClientState> priority(new ClientState(ClientState::ClientStateType::Inactive));

    ASSERT_EQ(std::string("<inactive xmlns=\"urn:xmpp:csi:0\"/>"), testling.serialize(priority));
}