public void undoTest() { ManipulationController t = ManipulationController.getInstance(); PrivateObject param0 = new PrivateObject(t); Controller_Accessor target = new Controller_Accessor(param0); PixelState p = PixelState.getInstance(); Bitmap b = new Bitmap(10, 10); Image img = (Image)b; ImageObject imgObj = new ImageObject(img, ImageManipulatorType.Name.GRAYSCALE); PictureBox pictureBox1 = new PictureBox(); pictureBox1.Image = img; target.setPictureBox(pictureBox1); Bitmap c = new Bitmap(13, 14); Image img2 = (Image)c; ImageObject imgObj2 = new ImageObject(img, ImageManipulatorType.Name.GRAYSCALE); p.add(imgObj2); target.undo(); Image i1 = imgObj2.get_Image(); Image i2 = Controller_Accessor.pic.Image; // Erwartet:<System.Drawing.Bitmap>. Tatsächlich:<System.Drawing.Bitmap> . Assert.AreEqual(i1, i2, "Das System wirft einen Fehler weil er bekommt was er erwartet. ALLES KLAAR!!! :("); }
public void setPictureBoxTest() { ManipulationController t = ManipulationController.getInstance(); PrivateObject param0 = new PrivateObject(t); Controller_Accessor target = new Controller_Accessor(param0); PictureBox pictureBox1 = new PictureBox(); t.setPictureBox(pictureBox1); Assert.AreSame(pictureBox1, Controller_Accessor.pic); }
public void setMainFormTest() { ManipulationController t = ManipulationController.getInstance(); Form1 form = new Form1(); // TODO: Passenden Wert initialisieren t.setMainForm(form); PrivateObject param0 = new PrivateObject(t); // TODO: Passenden Wert initialisieren Controller_Accessor target = new Controller_Accessor(param0); // TODO: Passenden Wert initialisieren Assert.AreSame(form, target.mainForm); }
public void ViewEventTest() { NewUi_Accessor target = new NewUi_Accessor(); // TODO: Initialize to an appropriate value string[] date = { null, "Urgent", "Done", "4/2/12", "1 jan 12 to 3jan 12", "from 11 dec 11 to 13 dec 11" }; // TODO: Initialize to an appropriate value string[] expected = { "No events.\n", "No events urgent.\n", "No events done.\n", "No events on 4/2/2012.\n", "No events from 1/1/2012 to 3/1/2012.\n", "No events from 11/12/2011 to 13/12/2011.\n" }; // TODO: Initialize to an appropriate value string[] actual = new string[date.Length]; Controller_Accessor.ClearAll(); for (int i = 0; i < date.Length; i++) { actual[i] = target.ProcessViewEvent(date[i]); } for (int i = 0; i < date.Length; i++) { Assert.AreEqual(expected[i], actual[i]); } }