#include #include #include namespace larra::xmpp { TEST(Parse, Variant) { xmlpp::Document doc; auto node = doc.create_root_node("stream:error"); node->add_child_element("unsupported-stanza-type"); node->set_namespace_declaration("urn:ietf:params:xml:ns:xmpp-streams"); auto streamError = Serialization::Parse(node); EXPECT_TRUE(std::get_if(&streamError)); } TEST(Serialize, Variant) { using S = Serialization; StreamError data = error::stream::UnsupportedStanzaType{}; xmlpp::Document doc; auto node = doc.create_root_node("stream:error"); S::Serialize(node, data); EXPECT_EQ(doc.write_to_string(), std::string_view{"\n\n"}); } } // namespace larra::xmpp