public void TestEncodeAndDecode() { String filepath = @"D:\OIC\IAS\Web\IAS\image\a-1.png"; byte[] img = FileToByteArray(filepath); String result = ByteArrayHelper.ConvertByteArrayToString(img); byte[] res = ByteArrayHelper.ConvertStringToByte(result); Assert.AreEqual(img, res); }