Esempio n. 1
0
        public void WriteFileBodyTest2()
        {
            string imagePath = PathHelper.GetFilePath(@"\Data\boy.bmp");
            Bitmap image     = new Bitmap(imagePath);

            byte[] bytesExpect = { 1, 2, 3, 4, 5, 6 };

            HideLSB.WriteFileBody(ref image, bytesExpect, 5, 7);
            byte[] bytesActual = HideLSB.ReadFileBody(image, 48, 5, 7);

            CollectionAssert.AreEqual(bytesExpect, bytesActual);
        }
Esempio n. 2
0
        public void WriteFileBodyTest1()
        {
            string dataPath = PathHelper.GetFilePath(@"\Data\testPng.png");

            byte[] bytesExpect = FileTransform.File2ByteArray(dataPath);

            string imagePath = PathHelper.GetFilePath(@"\Data\boy.bmp");
            Bitmap image     = new Bitmap(imagePath);

            HideLSB.WriteFileBody(ref image, bytesExpect, 0, 0);
            byte[] bytesActual = HideLSB.ReadFileBody(image, bytesExpect.Length * 8, 0, 0);

            CollectionAssert.AreEqual(bytesExpect, bytesActual);
        }