示例#1
0
 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);
 }
示例#2
0
 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.");
 }
示例#3
0
 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");
 }
示例#4
0
 public void typeTest()
 {
     Invert target = new Invert();
     PluginType expected = PluginType.IFilterOqat;
     PluginType actual;
     target.type = expected;
     actual = target.type;
     Assert.AreEqual(expected, actual);
 }
示例#5
0
 public void setMementoTest_empty()
 {
     Invert target = new Invert();
     Memento memento = null;
     Memento expected = memento;
     target.setMemento(expected);
     Assert.AreEqual(expected, null);
 }
示例#6
0
 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.");
 }
示例#7
0
 public void propertyViewTest()
 {
     Invert target = new Invert();
     UserControl actual;
     UserControl expected = null;
     actual = target.propertyView;
     Assert.AreEqual(expected, actual);
 }
示例#8
0
 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));
         }
     }
 }
示例#9
0
 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));
 }
示例#10
0
 public void namePluginTest()
 {
     Invert target = new Invert();
     string expected = "Invert";
     string actual;
     target.namePlugin = expected;
     actual = target.namePlugin;
     Assert.AreEqual(expected, actual);
 }
示例#11
0
 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?
 }