diff --git a/src/message/poll.rs b/src/message/poll.rs index 018b959..3d48034 100644 --- a/src/message/poll.rs +++ b/src/message/poll.rs @@ -148,4 +148,19 @@ mod tests { assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); } + + #[test] + fn empty_queue_response() { + let xml = get_xml("response/message/poll_empty_queue.xml").unwrap(); + let object = MessagePoll::deserialize_response(xml.as_str()).unwrap(); + + assert_eq!(object.result.code, 1300); + assert_eq!( + object.result.message, + "Command completed successfully; no messages".into() + ); + + assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); + assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); + } } diff --git a/tests/resources/response/message/poll_empty_queue.xml b/tests/resources/response/message/poll_empty_queue.xml new file mode 100644 index 0000000..67cc323 --- /dev/null +++ b/tests/resources/response/message/poll_empty_queue.xml @@ -0,0 +1,12 @@ + + + + + Command completed successfully; no messages + + + cltrid:1626454866 + RO-6879-1627224678242975 + + + \ No newline at end of file