Exemplo n.º 1
0
        public void GetMessages(Messages messagesObj)
        {
            var data     = messagesObj.Data;
            var bytes    = BuildXmlBytes(data);
            var messages = FastXmlAzureParser.ParseGetMessages(bytes);

            Assert.AreEqual(data.Length, messages.Count);

            for (var i = 0; i < data.Length; i++)
            {
                var messageData = data[i];
                var msg         = messages[i];

                var expectedMessagePayload = Convert.FromBase64String(messageData.MessageText);

                Assert.AreEqual(messageData.Id, msg.Id);
                CollectionAssert.AreEqual(expectedMessagePayload, msg.Payload.ToArray(), "Payload is wrongly deserialized");
                Assert.AreEqual(messageData.DequeueCount, msg.DequeueCount);
                Assert.AreEqual(messageData.PopReceipt, msg.PopReceipt);
            }
        }
Exemplo n.º 2
0
 public List <Message> QueueBatch_custom_parser()
 {
     return(FastXmlAzureParser.ParseGetMessages(new Memory <byte>(payload)));
 }