public void CreateImageInfo_WithFileName_ReturnsMagickImageInfo() { MagickFactory factory = new MagickFactory(); IMagickImageInfo imageInfo = factory.CreateImageInfo(Files.ImageMagickJPG); Assert.IsInstanceOfType(imageInfo, typeof(MagickImageInfo)); Assert.AreEqual(123, imageInfo.Width); }
public void ShouldCreateMagickImageInfo() { IMagickFactory factory = new MagickFactory(); IMagickImageInfo info = factory.CreateImageInfo(); Assert.IsInstanceOfType(info, typeof(MagickImageInfo)); Assert.AreEqual(0, info.Width); }
public void CreateImageInfo_ReturnsMagickImageInfo() { MagickFactory factory = new MagickFactory(); IMagickImageInfo imageInfo = factory.CreateImageInfo(); Assert.IsInstanceOfType(imageInfo, typeof(MagickImageInfo)); Assert.AreEqual(0, imageInfo.Width); }
public void ShouldThrowExceptionWhenOffsetIsNegative() { IMagickFactory factory = new MagickFactory(); ExceptionAssert.Throws <ArgumentException>("offset", () => { factory.CreateImageInfo(new byte[] { 215 }, -1, 0); }); }
public void ShouldThrowExceptionWhenFileNameIsEmpty() { IMagickFactory factory = new MagickFactory(); ExceptionAssert.Throws <ArgumentException>("fileName", () => { factory.CreateImageInfo(string.Empty); }); }
public void ShouldThrowExceptionWhenArrayIsNull() { IMagickFactory factory = new MagickFactory(); ExceptionAssert.Throws <ArgumentNullException>("data", () => { factory.CreateImageInfo(null, 0, 0); }); }
public void ShouldThrowExceptionWhenArrayIsEmpty() { IMagickFactory factory = new MagickFactory(); ExceptionAssert.Throws <ArgumentException>("data", () => { factory.CreateImageInfo(new byte[] { }, 0, 0); }); }
public void ShouldThrowExceptionWhenStreamIsEmpty() { IMagickFactory factory = new MagickFactory(); ExceptionAssert.Throws <ArgumentException>("stream", () => { factory.CreateImageInfo(new MemoryStream()); }); }
public void ShouldThrowExceptionWhenFileInfoIsNull() { IMagickFactory factory = new MagickFactory(); ExceptionAssert.Throws <ArgumentNullException>("fileName", () => { factory.CreateImageInfo((string)null); }); }
public void ShouldThrowExceptionWhenStreamIsNull() { IMagickFactory factory = new MagickFactory(); ExceptionAssert.Throws <ArgumentNullException>("stream", () => { factory.CreateImageInfo((Stream)null); }); }
public void ShouldThrowExceptionWhenCountIsZero() { IMagickFactory factory = new MagickFactory(); ExceptionAssert.Throws <ArgumentException>("count", () => { factory.CreateImageInfo(new byte[] { 215 }, 0, 0); }); }
public void ShouldCreateMagickImage() { IMagickFactory factory = new MagickFactory(); var data = File.ReadAllBytes(Files.ImageMagickJPG); IMagickImageInfo info = factory.CreateImageInfo(data); Assert.IsInstanceOfType(info, typeof(MagickImageInfo)); Assert.AreEqual(123, info.Width); }
public void CreateImageInfo_WithBytes_ReturnsMagickImageInfo() { var data = File.ReadAllBytes(Files.ImageMagickJPG); MagickFactory factory = new MagickFactory(); IMagickImageInfo imageInfo = factory.CreateImageInfo(data); Assert.IsInstanceOfType(imageInfo, typeof(MagickImageInfo)); Assert.AreEqual(123, imageInfo.Width); }
public void ShouldCreateMagickImage() { IMagickFactory factory = new MagickFactory(); var file = new FileInfo(Files.ImageMagickJPG); IMagickImageInfo info = factory.CreateImageInfo(file); Assert.IsInstanceOfType(info, typeof(MagickImageInfo)); Assert.AreEqual(123, info.Width); }
public void CreateImageInfo_WithBytesAndSettings_ReturnsMagickImageInfo() { var data = new byte[] { 255 }; MagickReadSettings readSettings = CreateReadSettings(); MagickFactory factory = new MagickFactory(); IMagickImageInfo imageInfo = factory.CreateImageInfo(data, readSettings); Assert.IsInstanceOfType(imageInfo, typeof(MagickImageInfo)); Assert.AreEqual(1, imageInfo.Width); }
public void CreateImageInfo_WithStream_ReturnsMagickImageInfo() { using (var stream = File.OpenRead(Files.ImageMagickJPG)) { MagickFactory factory = new MagickFactory(); IMagickImageInfo imageInfo = factory.CreateImageInfo(stream); Assert.IsInstanceOfType(imageInfo, typeof(MagickImageInfo)); Assert.AreEqual(123, imageInfo.Width); } }
public void ShouldCreateMagickImage() { IMagickFactory factory = new MagickFactory(); using (var stream = File.OpenRead(Files.ImageMagickJPG)) { IMagickImageInfo info = factory.CreateImageInfo(stream); Assert.IsInstanceOfType(info, typeof(MagickImageInfo)); Assert.AreEqual(123, info.Width); } }
public void CreateImageInfo_WithFileNameAndSettings_ReturnsMagickImageInfo() { var data = new byte[] { 255 }; var readSettings = CreateReadSettings(); using (TemporaryFile file = new TemporaryFile(data)) { MagickFactory factory = new MagickFactory(); IMagickImageInfo imageInfo = factory.CreateImageInfo(file.FullName, readSettings); Assert.IsInstanceOfType(imageInfo, typeof(MagickImageInfo)); Assert.AreEqual(1, imageInfo.Width); } }