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); }); }
private static void SetColumn_InvalidColumn_ThrowsException(int x) { MagickColorMatrix matrix = new MagickColorMatrix(2); ExceptionAssert.ThrowsArgumentOutOfRangeException("x", () => { matrix.SetColumn(x, 1.0, 2.0); }); }
private static void SetRow_InvalidRow_ThrowsException(int y) { MagickColorMatrix matrix = new MagickColorMatrix(2); ExceptionAssert.ThrowsArgumentOutOfRangeException("y", () => { matrix.SetRow(y, 1.0, 2.0); }); }
private static void SetRow_InvalidRow_ThrowsException(int y) { ConvolveMatrix matrix = new ConvolveMatrix(1); ExceptionAssert.ThrowsArgumentOutOfRangeException("y", () => { matrix.SetRow(y, 1.0, 2.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]; }); }
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"); }); } } }
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); }); } } }
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)); }); } } }
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 }); }); } } }
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]; }); } } }
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]; }); } } }
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); }); } } }
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); }); } } }