public void SetPixelFast() { var testBitmap = TestingHelper.GetTestBitmap(); using (var testBitmapUnlocked = TestingHelper.GetTestBitmap()) { using (var fast = new FastBitmapPixelProvider(testBitmap, true)) { for (int x = 0; x < testBitmap.Width; ++x) { for (int y = 0; y < testBitmap.Height; ++y) { NativeColor expected = TestingHelper.GetRandomColor(); testBitmapUnlocked.SetPixel(x, y, expected.ToDrawingColor()); fast.SetPixel(x, y, expected); var actualNative = NativeColor.FromDrawingColor(testBitmapUnlocked.GetPixel(x, y)); var actualFast = fast.GetPixel(x, y); AssertEx.AreEqual<NativeColor>(expected, actualNative); AssertEx.AreEqual<NativeColor>(expected, actualFast); } } } } }