public void ShouldThrowExceptionWhenArrayIsNull() { ExceptionAssert.ThrowsArgumentNullException("data", () => { using (IMagickImageCollection images = new MagickImageCollection()) { images.Ping((byte[])null); } }); }
public void ShouldThrowExceptionWhenFileNameIsNull() { ExceptionAssert.ThrowsArgumentNullException("fileName", () => { using (IMagickImageCollection images = new MagickImageCollection()) { images.Ping((string)null); } }); }
public void ShouldThrowExceptionWhenStreamIsNull() { using (IMagickImage image = new MagickImage()) { ExceptionAssert.ThrowsArgumentNullException("stream", () => { image.Read((Stream)null); }); } }
public void ShouldThrowExceptionWhenEnumerableImagesIsNull() { ExceptionAssert.ThrowsArgumentNullException("images", () => { using (IMagickImageCollection images = new MagickImageCollection()) { images.AddRange((IEnumerable <IMagickImage>)null); } }); }
public void ShouldThrowExceptionWhenByteArrayIsNull() { using (IMagickImage image = new MagickImage()) { ExceptionAssert.ThrowsArgumentNullException("data", () => { image.Read((byte[])null); }); } }
public void ShouldThrowExceptionWhenFileNameIsNull() { using (IMagickImage image = new MagickImage()) { ExceptionAssert.ThrowsArgumentNullException("fileName", () => { image.Read((string)null); }); } }
public void ShouldThrowAnExceptionWhenDifferenceIsNull() { using (IMagickImage image = new MagickImage()) { ExceptionAssert.ThrowsArgumentNullException("difference", () => { image.Compare(image, new CompareSettings(), null); }); } }
public void ShouldThrowExceptionWhenNameIsNull() { var document = new XmlDocument(); var scriptVariables = new ScriptVariables(document); ExceptionAssert.ThrowsArgumentNullException("name", () => { scriptVariables[null] = "42"; }); }
public void ShouldThrowExceptionWhenPixelStorageSettingsIsNullAndFileInfoIsSpecified() { ExceptionAssert.ThrowsArgumentNullException("pixelStorageSettings", () => { using (IMagickImage image = new MagickImage()) { image.ReadPixels(new FileInfo(Files.CirclePNG), null); } }); }
public void ShouldThrowAnExceptionWhenImageIsNull() { using (IMagickImage image = new MagickImage()) { ExceptionAssert.ThrowsArgumentNullException("image", () => { image.Compare(null); }); } }
public void ShouldThrowExceptionWhenPixelStorageSettingsIsNullAndByteArrayIsSpecified() { ExceptionAssert.ThrowsArgumentNullException("pixelStorageSettings", () => { using (IMagickImage image = new MagickImage()) { image.ReadPixels(new byte[] { 215 }, null); } }); }
public void ShouldThrowExceptionWhenStreamIsNullAndPixelReadSettingsIsSpecified() { ExceptionAssert.ThrowsArgumentNullException("stream", () => { var settings = new PixelReadSettings(); MagickFactory factory = new MagickFactory(); factory.CreateImage((Stream)null, settings); }); }
public void ShouldThrowExceptionWhenFileInfoIsNullAndPixelStorageSettingsIsSpecified() { ExceptionAssert.ThrowsArgumentNullException("file", () => { var pixelStorageSettings = new PixelStorageSettings(); MagickFactory factory = new MagickFactory(); factory.CreateImage((FileInfo)null, pixelStorageSettings); }); }
public void ShouldThrowExceptionWhenByteArrayIsNullAndPixelStorageSettingsIsSpecified() { ExceptionAssert.ThrowsArgumentNullException("data", () => { var pixelStorageSettings = new PixelStorageSettings(); MagickFactory factory = new MagickFactory(); factory.CreateImage((byte[])null, pixelStorageSettings); }); }
public void ShouldThrowExceptionWhenStreamIsNull() { ExceptionAssert.ThrowsArgumentNullException("stream", () => { using (IMagickImageCollection images = new MagickImageCollection()) { images.Ping((Stream)null); } }); }
public void ShouldThrowExceptionWhenTermsIsNull() { using (IMagickImageCollection images = new MagickImageCollection(Files.Builtin.Logo)) { ExceptionAssert.ThrowsArgumentNullException("terms", () => { images.Polynomial(null); }); } }
public void Test_Read() { IMagickImageInfo imageInfo = new MagickImageInfo(); ExceptionAssert.ThrowsArgumentException("data", () => { imageInfo.Read(new byte[0]); }); ExceptionAssert.ThrowsArgumentNullException("data", () => { imageInfo.Read((byte[])null); }); ExceptionAssert.ThrowsArgumentNullException("file", () => { imageInfo.Read((FileInfo)null); }); ExceptionAssert.ThrowsArgumentNullException("stream", () => { imageInfo.Read((Stream)null); }); ExceptionAssert.ThrowsArgumentNullException("fileName", () => { imageInfo.Read((string)null); }); ExceptionAssert.Throws <MagickBlobErrorException>(() => { imageInfo.Read(Files.Missing); }, "error/blob.c/OpenBlob"); imageInfo.Read(File.ReadAllBytes(Files.SnakewarePNG)); using (FileStream fs = File.OpenRead(Files.SnakewarePNG)) { imageInfo.Read(fs); } imageInfo.Read(Files.ImageMagickJPG); Assert.AreEqual(ColorSpace.sRGB, imageInfo.ColorSpace); Assert.AreEqual(CompressionMethod.JPEG, imageInfo.Compression); Assert.AreEqual(MagickFormat.Jpeg, imageInfo.Format); Assert.AreEqual(118, imageInfo.Height); Assert.AreEqual(72, imageInfo.Density.X); Assert.AreEqual(72, imageInfo.Density.Y); Assert.AreEqual(DensityUnit.PixelsPerInch, imageInfo.Density.Units); Assert.AreEqual(Interlace.NoInterlace, imageInfo.Interlace); Assert.AreEqual(100, imageInfo.Quality); Assert.AreEqual(123, imageInfo.Width); }
public void ShouldThrowExceptionWhenSettingsIsNull() { using (IMagickImageCollection images = new MagickImageCollection()) { images.Read(Files.RoseSparkleGIF); ExceptionAssert.ThrowsArgumentNullException("settings", () => { images.Map(images[0], null); }); } }
public void Quantize_SettingsAreNull_ThrowsException() { using (IMagickImageCollection collection = new MagickImageCollection()) { collection.Add(Files.FujiFilmFinePixS1ProJPG); ExceptionAssert.ThrowsArgumentNullException("settings", () => { collection.Quantize(null); }); } }
public void ShouldThrowExceptionWhenArrayIsNull() { ExceptionAssert.ThrowsArgumentNullException("data", () => { var settings = new MagickReadSettings(); using (IMagickImageCollection images = new MagickImageCollection()) { images.Read(null, 0, 0, settings); } }); }
public void ShouldThrowExceptionWhenSettingsIsNull() { using (IMagickImageCollection images = new MagickImageCollection()) { images.Add(Files.FujiFilmFinePixS1ProJPG); ExceptionAssert.ThrowsArgumentNullException("settings", () => { images.Quantize(null); }); } }
public void ShouldThrowExceptionWhenVariableNotSet() { MagickScript script = new MagickScript(Files.Scripts.Variables); using (IMagickImage image = new MagickImage(Files.MagickNETIconPNG)) { ExceptionAssert.ThrowsArgumentNullException("attribute", () => { script.Execute(image); }); } }
public void ShouldThrowExceptionWhenFileNameIsNull() { ExceptionAssert.ThrowsArgumentNullException("fileName", () => { var settings = new MagickReadSettings(); using (IMagickImage image = new MagickImage()) { image.Read((string)null, settings); } }); }
public void ShouldThrowExceptionWhenStreamIsNull() { ExceptionAssert.ThrowsArgumentNullException("stream", () => { var settings = new MagickReadSettings(); using (IMagickImage image = new MagickImage()) { image.Read((Stream)null, settings); } }); }
public void ShouldThrowExceptionWhenArrayIsNull() { ExceptionAssert.ThrowsArgumentNullException("data", () => { var settings = new MagickReadSettings(); using (IMagickImage image = new MagickImage()) { image.Read((byte[])null, settings); } }); }
public void ShouldThrowExceptionWhenFileInfoIsNull() { ExceptionAssert.ThrowsArgumentNullException("file", () => { var settings = new PixelReadSettings(); using (IMagickImage image = new MagickImage()) { image.ReadPixels((FileInfo)null, settings); } }); }
public void ShouldThrowExceptionWhenStreamIsNullAndPixelStorageSettingsIsSpecified() { ExceptionAssert.ThrowsArgumentNullException("stream", () => { var pixelStorageSettings = new PixelStorageSettings(); using (IMagickImage image = new MagickImage()) { image.ReadPixels((Stream)null, pixelStorageSettings); } }); }
public void ShouldThrowExceptionWhenImageIsNull() { using (IMagickImageCollection collection = new MagickImageCollection()) { collection.Read(Files.RoseSparkleGIF); ExceptionAssert.ThrowsArgumentNullException("image", () => { collection.Map(null); }); } }
public void ShouldThrowExceptionWhenByteArrayIsNullAndPixelReadSettingsIsSpecified() { ExceptionAssert.ThrowsArgumentNullException("data", () => { var settings = new PixelReadSettings(); using (IMagickImage image = new MagickImage()) { image.ReadPixels((byte[])null, settings); } }); }
public void ShouldThrowExceptionWhenGeometryIsSpecifiedAndMappingIsNull() { using (IMagickImage image = new MagickImage(Files.ImageMagickJPG)) { using (IPixelCollection pixels = image.GetPixels()) { ExceptionAssert.ThrowsArgumentNullException("mapping", () => { pixels.ToShortArray(new MagickGeometry(1, 2, 3, 4), null); }); } } }