public void TestNotificationUnpack()
{
// Encoding and decoding 3 events containing three strings.
byte[] buffer = new byte[2048];
ushort notifyAckIn = 6533;
ushort notifySeqIn = 23;
ushort notifyAckOut;
ushort notifySeqOut;
string firstStr = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
string secondStr = "sit amet tristique mauris pulvinar a. Fusce urna nulla, vehicula id pellentesque at";
string thirdStr = "Ut orci sapien, tincidunt eget volutpat sed, sagittis vel ante. Etiam sodales ante id justo condimentum, in tincidunt mi sagittis. Etiam maximus finibus sem.";
Queue<NetEvent> srcQueue = new Queue<NetEvent>();
srcQueue.Enqueue(CreateStringEvent(firstStr));
srcQueue.Enqueue(CreateStringEvent(secondStr));
srcQueue.Enqueue(CreateStringEvent(thirdStr));
int packedSize = NetEncoding.PackCarrier(buffer, notifyAckIn, notifySeqIn, srcQueue);
Queue<NetEvent> dstQueue = new Queue<NetEvent>();
bool result = NetEncoding.ReadCarrier(CreateEvent, null, buffer, packedSize, out notifyAckOut, out notifySeqOut, dstQueue);
NetEvent evntA = dstQueue.Dequeue();
NetEvent evntB = dstQueue.Dequeue();
NetEvent evntC = dstQueue.Dequeue();
Assert.AreEqual(true, result);
Assert.AreEqual(notifyAckIn, notifyAckOut);
Assert.AreEqual(notifySeqIn, notifySeqOut);
Assert.AreEqual(firstStr, Encoding.UTF8.GetString(evntA.EncodedData, 0, evntA.EncodedLength));
Assert.AreEqual(secondStr, Encoding.UTF8.GetString(evntB.EncodedData, 0, evntB.EncodedLength));
Assert.AreEqual(thirdStr, Encoding.UTF8.GetString(evntC.EncodedData, 0, evntC.EncodedLength));
}