public void Test_CopyTo()
    {
      using (MagickImageCollection collection = new MagickImageCollection())
      {
        collection.Add(new MagickImage(Files.SnakewarePNG));
        collection.Add(new MagickImage(Files.RoseSparkleGIF));

        MagickImage[] images = new MagickImage[collection.Count];
        collection.CopyTo(images, 0);

        Assert.AreEqual(collection[0], images[0]);
        Assert.AreNotEqual(collection[0], images[1]);

        collection.CopyTo(images, 1);
        Assert.AreEqual(collection[0], images[0]);
        Assert.AreEqual(collection[0], images[1]);

        images = new MagickImage[collection.Count + 1];
        collection.CopyTo(images, 0);

        images = new MagickImage[1];
        collection.CopyTo(images, 0);

        ExceptionAssert.Throws<ArgumentNullException>(delegate ()
        {
          collection.CopyTo(null, -1);
        });

        ExceptionAssert.Throws<ArgumentOutOfRangeException>(delegate ()
        {
          collection.CopyTo(images, -1);
        });
      }
    }