private void Test_Component(MagickImage image, ConnectedComponent component, int x, int y, int width, int height)
{
int delta = 2;
Assert.AreEqual(x, component.X, delta);
Assert.AreEqual(y, component.Y, delta);
Assert.AreEqual(width, component.Width, delta);
Assert.AreEqual(height, component.Height, delta);
using (MagickImage area = image.Clone())
{
area.Crop(component.ToGeometry(10));
Assert.AreEqual(width + 20, area.Width, delta);
Assert.AreEqual(height + 20, area.Height, delta);
}
}