public static void MyClassInitialize(TestContext testContext) { Invert inv = new Invert(); testMemento = new Memento("Invert", inv); testBitmap = new Bitmap(100, 100); for (int height = 0; height < testBitmap.Height; height++) { for (int width = 0; width < testBitmap.Width; width++) { testBitmap.SetPixel(width, height, Color.White); width++; testBitmap.SetPixel(width, height, Color.Black); width++; testBitmap.SetPixel(width, height, Color.Red); width++; testBitmap.SetPixel(width, height, Color.Green); width++; testBitmap.SetPixel(width, height, Color.Blue); } } processedBitmap = inv.process(testBitmap); }
public void processTest_notSameBitmap() { Invert target = new Invert(); Bitmap frame = new Bitmap(testBitmap); Bitmap expected = new Bitmap(testBitmap); Bitmap actual; actual = target.process(frame); for (int height = 0; height < expected.Height; height++) { for (int width = 0; width < expected.Width; width++) { Assert.AreNotEqual(expected.GetPixel(height, width), actual.GetPixel(height, width)); } } }
public void processTest_empty() { Invert target = new Invert(); Bitmap frame = new Bitmap(15, 15); Bitmap expected = new Bitmap(15, 15); Bitmap actual; actual = target.process(frame); Assert.AreEqual(expected.GetPixel(5, 5), expected.GetPixel(5, 5)); }