private static MagickImage ExecuteDeconstruct(MagickImageCollection collection) { collection.Deconstruct(); return null; }
public void Test_Deconstruct() { using (MagickImageCollection collection = new MagickImageCollection()) { ExceptionAssert.Throws<InvalidOperationException>(delegate () { collection.Deconstruct(); }); collection.Add(new MagickImage(MagickColors.Red, 20, 20)); using (MagickImageCollection frames = new MagickImageCollection()) { frames.Add(new MagickImage(MagickColors.Red, 10, 20)); frames.Add(new MagickImage(MagickColors.Purple, 10, 20)); collection.Add(frames.AppendHorizontally()); } Assert.AreEqual(20, collection[1].Width); Assert.AreEqual(20, collection[1].Height); Assert.AreEqual(new MagickGeometry(0, 0, 20, 20), collection[1].Page); ColorAssert.AreEqual(MagickColors.Red, collection[1], 3, 3); collection.Deconstruct(); Assert.AreEqual(10, collection[1].Width); Assert.AreEqual(20, collection[1].Height); Assert.AreEqual(new MagickGeometry(10, 0, 20, 20), collection[1].Page); ColorAssert.AreEqual(MagickColors.Purple, collection[1], 3, 3); } }
private static MagickImage ExecuteDeconstruct(MagickImageCollection collection) { collection.Deconstruct(); return(null); }