Exemplo n.º 1
0
        private static void SetValue_InvalidIndex_ThrowsException(string paramName, int x, int y)
        {
            MagickColorMatrix matrix = new MagickColorMatrix(2);

            ExceptionAssert.ThrowsArgumentOutOfRangeException(paramName, () =>
            {
                matrix.SetValue(x, y, 1);
            });
        }
Exemplo n.º 2
0
        private static void SetColumn_InvalidColumn_ThrowsException(int x)
        {
            MagickColorMatrix matrix = new MagickColorMatrix(2);

            ExceptionAssert.ThrowsArgumentOutOfRangeException("x", () =>
            {
                matrix.SetColumn(x, 1.0, 2.0);
            });
        }
Exemplo n.º 3
0
        private static void SetRow_InvalidRow_ThrowsException(int y)
        {
            MagickColorMatrix matrix = new MagickColorMatrix(2);

            ExceptionAssert.ThrowsArgumentOutOfRangeException("y", () =>
            {
                matrix.SetRow(y, 1.0, 2.0);
            });
        }
Exemplo n.º 4
0
        private static void SetRow_InvalidRow_ThrowsException(int y)
        {
            ConvolveMatrix matrix = new ConvolveMatrix(1);

            ExceptionAssert.ThrowsArgumentOutOfRangeException("y", () =>
            {
                matrix.SetRow(y, 1.0, 2.0);
            });
        }
Exemplo n.º 5
0
        private static void Indexer_InvalidIndex_ThrowsException(string paramName, int x, int y)
        {
            MagickColorMatrix matrix = new MagickColorMatrix(2);

            ExceptionAssert.ThrowsArgumentOutOfRangeException(paramName, () =>
            {
                double foo = matrix[x, y];
            });
        }
Exemplo n.º 6
0
        private static void GetValue_InvalidIndex_ThrowsException(string paramName, int x, int y)
        {
            ConvolveMatrix matrix = new ConvolveMatrix(1);

            ExceptionAssert.ThrowsArgumentOutOfRangeException(paramName, () =>
            {
                matrix.GetValue(x, y);
            });
        }
 public void ShouldThrowExceptionWhenXTooLow()
 {
     using (IMagickImage image = new MagickImage(Files.ImageMagickJPG))
     {
         using (IPixelCollection pixels = image.GetPixels())
         {
             ExceptionAssert.ThrowsArgumentOutOfRangeException("x", () =>
             {
                 pixels.ToShortArray(-1, 0, 1, 1, "RGB");
             });
         }
     }
 }
Exemplo n.º 8
0
 private static void ThrowsArgumentOutOfRangeException(string paramName, int x, int y)
 {
     using (IMagickImage image = new MagickImage(MagickColors.Red, 5, 10))
     {
         using (IPixelCollection pixels = image.GetPixels())
         {
             ExceptionAssert.ThrowsArgumentOutOfRangeException(paramName, () =>
             {
                 pixels.GetValue(x, y);
             });
         }
     }
 }
Exemplo n.º 9
0
 public void ShouldThrowExceptionWhenPixelHeightIsOutsideImage()
 {
     using (IMagickImage image = new MagickImage(Files.ImageMagickJPG))
     {
         using (IPixelCollection pixels = image.GetPixels())
         {
             ExceptionAssert.ThrowsArgumentOutOfRangeException("y", () =>
             {
                 pixels.SetPixel(new Pixel(0, image.Height + 1, 3));
             });
         }
     }
 }
Exemplo n.º 10
0
 public void ShouldThrowExceptionWhenOffsetWidthIsOutsideImage()
 {
     using (IMagickImage image = new MagickImage(Files.ImageMagickJPG))
     {
         using (IPixelCollection pixels = image.GetPixels())
         {
             ExceptionAssert.ThrowsArgumentOutOfRangeException("x", () =>
             {
                 pixels.SetPixel(image.Width + 1, 0, new QuantumType[] { 0 });
             });
         }
     }
 }
Exemplo n.º 11
0
 public void ShouldThrowExceptionWhenHeightOutOfRange()
 {
     using (IMagickImage image = new MagickImage(Files.ImageMagickJPG))
     {
         using (IPixelCollection pixels = image.GetPixels())
         {
             ExceptionAssert.ThrowsArgumentOutOfRangeException("y", () =>
             {
                 Pixel pixel = pixels[0, image.Height + 1];
             });
         }
     }
 }
Exemplo n.º 12
0
 public void Indexer_OutsideImage_ThrowsException()
 {
     using (IMagickImage image = new MagickImage(Files.RedPNG))
     {
         using (IPixelCollection pixels = image.GetPixels())
         {
             ExceptionAssert.ThrowsArgumentOutOfRangeException("x", () =>
             {
                 Pixel pixel = pixels[image.Width + 1, 0];
             });
         }
     }
 }
Exemplo n.º 13
0
 public void GetPixel_OutsideImage_ThrowsException()
 {
     using (IMagickImage image = new MagickImage(Files.MagickNETIconPNG))
     {
         using (IPixelCollection pixels = image.GetPixels())
         {
             ExceptionAssert.ThrowsArgumentOutOfRangeException("x", () =>
             {
                 pixels.GetPixel(image.Width + 1, 0);
             });
         }
     }
 }
Exemplo n.º 14
0
 private static void GetArea_ThrowsException(string paramName, int x, int y, int width, int height)
 {
     using (IMagickImage image = new MagickImage(MagickColors.Red, 5, 10))
     {
         using (IPixelCollection pixels = image.GetPixels())
         {
             ExceptionAssert.ThrowsArgumentOutOfRangeException(paramName, () =>
             {
                 pixels.GetArea(x, y, width, height);
             });
         }
     }
 }