From e66a21176a987a1c81d8abc49133bd6696349d09 Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Thu, 5 Dec 2019 21:19:19 +0100 Subject: [PATCH] Add serialization test for forwaded element --- xmpp-parsers/src/forwarding.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/xmpp-parsers/src/forwarding.rs b/xmpp-parsers/src/forwarding.rs index f51c6bb..1b786ac 100644 --- a/xmpp-parsers/src/forwarding.rs +++ b/xmpp-parsers/src/forwarding.rs @@ -74,6 +74,26 @@ mod tests { #[test] fn test_serialize_with_delay_and_stanza() { - assert!(false); + let reference: Element = "" + .parse() + .unwrap(); + + let elem: Element = "" + .parse() + .unwrap(); + let message = Message::try_from(elem).unwrap(); + + let elem: Element = "" + .parse() + .unwrap(); + let delay = Delay::try_from(elem).unwrap(); + + let forwarded = Forwarded { + delay: Some(delay), + stanza: Some(message) + }; + + let serialized: Element = forwarded.into(); + assert_eq!(serialized, reference); } }