Exemple #1
0
        public void Encode_Test_if_throws_Exception_When_Message_Length_Is_Over_Capacity()
        {
            Bitmap inputBitmap = new Bitmap(16, 16);
            inputBitmap.SetPixel(8,8, Color.White);
            

            Bitmap scaledBitmap = new Bitmap(inputBitmap, 200, 200);
            JpegImage ji = new JpegImage(scaledBitmap, 100, 4); // Maximum length is 22
            
            byte[] msg = new byte[50];

            Assert.Throws<ImageCannotContainDataException>(() => ji.Encode(msg));
        }
 public void setUp() {
     JpegImage ji = new JpegImage(StegosaurusTests.Properties.Resources._out, 100, 4);
     ji.Encode(new byte[] { 1, 2, 3, 4, 5 });
     ji.Save("out.jpg");
 }