コード例 #1
0
        public void EmbedTest(string msg, string bitmapName)
        {
            var msgBytes        = Encoding.ASCII.GetBytes(msg);
            var bitmapPath      = BitmapsDir + bitmapName + BitmapExt;
            var stegoBitmapPath = BitmapsDir + bitmapName + StegoSuffix + BitmapExt;

            var pixels         = Stego.ReadBitmap(bitmapPath);
            var expectedPixels = Stego.Embed(pixels, msgBytes);

            Stego.WriteBitmap(expectedPixels, bitmapPath, stegoBitmapPath);

            Embed(pixels, msgBytes, msgBytes.Length);

            CollectionAssert.AreEqual(expectedPixels, pixels);
        }