/* * Copyright (c) 2017 Tarun Gupta * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #include #include #include using namespace Swift; TEST(MIXParticipantSerializerTest, testSerializeEmpty) { MIXParticipantSerializer testling; std::shared_ptr participant(new MIXParticipant()); std::string expectedResult = ""; ASSERT_EQ(expectedResult, testling.serialize(participant)); } TEST(MIXParticipantSerializerTest, testSerializeNick) { MIXParticipantSerializer testling; std::shared_ptr participant(new MIXParticipant()); participant->setNick("thirdwitch"); std::string expectedResult = "" "thirdwitch" ""; ASSERT_EQ(expectedResult, testling.serialize(participant)); } TEST(MIXParticipantSerializerTest, testSerializeJID) { MIXParticipantSerializer testling; std::shared_ptr participant(new MIXParticipant()); participant->setJID(JID("hecate@mix.shakespeare.example")); std::string expectedResult = "" "hecate@mix.shakespeare.example" ""; ASSERT_EQ(expectedResult, testling.serialize(participant)); } TEST(MIXParticipantSerializerTest, testSerializeJIDAndNick) { MIXParticipantSerializer testling; std::shared_ptr participant(new MIXParticipant()); participant->setNick("thirdwitch"); participant->setJID(JID("hecate@mix.shakespeare.example")); std::string expectedResult = "" "thirdwitch" "hecate@mix.shakespeare.example" ""; ASSERT_EQ(expectedResult, testling.serialize(participant)); }