Tests.TestNetEncoding.TestPayloadPack C# (CSharp) Method

TestPayloadPack() private method

private TestPayloadPack ( ) : void
return void
        public void TestPayloadPack()
        {
            byte[] buffer = new byte[2048];

              int length;

              string firstStr = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
              byte[] firstBytes = Encoding.UTF8.GetBytes(firstStr);
              ushort seqIn = 42323;
              ushort seqOut;

              length = NetEncoding.PackPayload(buffer, seqIn, firstBytes, (ushort)firstBytes.Length);
              NetEvent evnt;
              bool result = NetEncoding.ReadPayload(CreateEvent, null, buffer, length, out seqOut, out evnt);

              Assert.AreEqual(true, result);
              Assert.AreEqual(seqIn, seqOut);
              Assert.AreEqual(firstStr, Encoding.UTF8.GetString(evnt.EncodedData, 0, evnt.EncodedLength));
        }