diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/UnitTest/ClientStateSerializerTest.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/UnitTest/ClientStateSerializerTest.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ClientStateSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ClientStateSerializerTest.cpp new file mode 100644 index 0000000..1622354 --- /dev/null +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ClientStateSerializerTest.cpp @@ -0,0 +1,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)); +} |