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 getMementoTest_isMemento() { Invert target = new Invert(); Memento actual; actual = target.getMemento(); Assert.IsTrue(actual is Memento, "Mememento is not set at the start."); }
public void getMementoTest() { Invert target = new Invert(); Memento actual; actual = target.getMemento(); Assert.IsTrue(actual.state is Invert, "State object of the beginning Memento is not Invert"); }
public void typeTest() { Invert target = new Invert(); PluginType expected = PluginType.IFilterOqat; PluginType actual; target.type = expected; actual = target.type; Assert.AreEqual(expected, actual); }
public void setMementoTest_empty() { Invert target = new Invert(); Memento memento = null; Memento expected = memento; target.setMemento(expected); Assert.AreEqual(expected, null); }
public void setMementoTest_notMemento() { Invert target = new Invert(); List<Memento> memList = new List<Memento>(); Memento memento = new Memento("Invert", memList); target.setMemento(memento); Assert.IsTrue(target.getMemento().state is Invert, "Invert doesn't care about Memento's, it does not need any."); }
public void propertyViewTest() { Invert target = new Invert(); UserControl actual; UserControl expected = null; actual = target.propertyView; Assert.AreEqual(expected, actual); }
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)); }
public void namePluginTest() { Invert target = new Invert(); string expected = "Invert"; string actual; target.namePlugin = expected; actual = target.namePlugin; Assert.AreEqual(expected, actual); }
public void InvertConstructorTest() { Invert target = new Invert(); Assert.IsTrue(target is Invert, "The returned object is not a valid Invert instance."); //TODO überprüfen ob Invert nur einmal existieren darf? }