#include #include #include namespace larra::xmpp { namespace tests::message { struct SomeStruct { static constexpr auto kDefaultName = "some"; XmlLanguage language; friend auto operator<<(xmlpp::Element*, const SomeStruct&) -> void; static auto Parse(xmlpp::Element* node) -> SomeStruct; }; } // namespace tests::message template <> constexpr auto serialization::kSerializationConfig = serialization::SerializationConfig{}; namespace tests::message { auto SomeStruct::Parse(xmlpp::Element* element) -> SomeStruct { return serialization::Parse(element); } auto operator<<(xmlpp::Element* element, const SomeStruct& some) -> void { serialization::Serialize(element, some); }; } // namespace tests::message TEST(Parse, XmlLanguage) { xmlpp::Document doc; auto node = doc.create_root_node("some"); node->set_attribute("lang", "en", "xml"); auto value = Serialization::Parse(node); EXPECT_EQ(value.language, "en"); } } // namespace larra::xmpp