public void EncodeTest() { var packer = new TextPacker(); Exception ex; var data = packer.Encode(Encoding.Default.GetBytes("helloworld"), out ex); Assert.AreEqual("helloworld\n", Encoding.Default.GetString((byte[])data)); }
public void TestEncodeNullData() { var packer = new TextPacker(); Exception ex; var data = packer.Encode(null, out ex); Assert.AreEqual(null, data); Assert.AreNotEqual(null, ex); }
public void MulDataInput() { var packer = new TextPacker(); Exception ex; var data = packer.Input(Encoding.Default.GetBytes("hello"), out ex); Assert.AreEqual(0, data); data = packer.Input(Encoding.Default.GetBytes("helloworld\n"), out ex); Assert.AreEqual(11, data); }
public void InputTests() { var packer = new TextPacker(); Exception ex; var length = packer.Input(Encoding.Default.GetBytes("hello\nworld"), out ex); Assert.AreEqual(6, length); length = packer.Input(Encoding.Default.GetBytes("helloworld"), out ex); Assert.AreEqual(0, length); }