public void PixelPoolDoesNotThrowWhenReturningNonPooled() { Color[] pixels = new Color[1024]; PixelPool <Color> .ReturnPixels(pixels); Assert.True(pixels.Length >= 1024); }
public void PixelPoolCleansRentedArray() { Color[] pixels = PixelPool <Color> .RentPixels(256); for (int i = 0; i < pixels.Length; i++) { pixels[i] = Color.Azure; } Assert.True(pixels.All(p => p == Color.Azure)); PixelPool <Color> .ReturnPixels(pixels); Assert.True(pixels.All(p => p == default(Color))); }
public void PixelPoolRentsEmptyArray() { for (int i = 16; i < 1024; i += 16) { Color[] pixels = PixelPool <Color> .RentPixels(i); Assert.True(pixels.All(p => p == default(Color))); PixelPool <Color> .ReturnPixels(pixels); } for (int i = 16; i < 1024; i += 16) { Color[] pixels = PixelPool <Color> .RentPixels(i); Assert.True(pixels.All(p => p == default(Color))); PixelPool <Color> .ReturnPixels(pixels); } }
public void PixelPoolRentsMinimumSize() { Color[] pixels = PixelPool <Color> .RentPixels(1024); Assert.True(pixels.Length >= 1024); }
public VideoCapture() { pixelPool = new PixelPool(10); }