Beispiel #1
0
        public void TestEncodeNullData()
        {
            var       packer = new FramePacker();
            Exception ex;
            var       data = packer.Encode(null, out ex);

            Assert.AreEqual(null, data);
            Assert.AreNotEqual(null, ex);
        }
Beispiel #2
0
        public void EncodeTest()
        {
            var       packer = new FramePacker();
            Exception ex;
            var       data = packer.Encode(Encoding.Default.GetBytes("helloworld"), out ex);

            Assert.AreEqual("14helloworld",
                            BitConverter.ToInt32(Arr.Slice(data, 0, 4), 0) + Encoding.Default.GetString(Arr.Slice(data, 4)));
        }