public void remove_lastTest() { PixelState target = PixelState.getInstance(); Bitmap b = new Bitmap(10, 10); Image img = (Image)b; ImageObject imgObj1 = new ImageObject(img, ImageManipulatorType.Name.INVERT); ImageObject imgObj2 = new ImageObject(img, ImageManipulatorType.Name.GRAYSCALE); ImageObject imgObj3 = new ImageObject(img, ImageManipulatorType.Name.RGB_RED); target.reset(); target.add(imgObj3); target.add(imgObj2); target.add(imgObj1); I_ImageObject img_last = target.remove_last(); Assert.AreEqual(img_last.get_ImageManipulatorType(), imgObj1.get_ImageManipulatorType()); img_last = target.remove_last(); Assert.AreEqual(img_last.get_ImageManipulatorType(), imgObj2.get_ImageManipulatorType()); img_last = target.remove_last(); Assert.AreEqual(img_last.get_ImageManipulatorType(), imgObj3.get_ImageManipulatorType()); img_last = target.remove_last(); Assert.IsNotNull(img_last); }
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 getInstanceTest() { PixelState expected = PixelState.getInstance(); PixelState actual; actual = PixelState.getInstance(); Assert.AreEqual(expected, actual); }
public void set_solutionTest() { PixelState.getInstance().set_pictureBox(new PictureBox()); WebcamController target = WebcamController.getInstance(); KeyValuePair <int, string> selob = new KeyValuePair <int, string>(); target.set_solution(selob); Assert.IsNotNull(target); }
public void initTest() { PictureBox pic = new PictureBox(); PixelState.getInstance().set_pictureBox(pic); WebcamController_Accessor target = WebcamController_Accessor.getInstance(); target.init(); Assert.IsNotNull(target); }
public void show_Webcam_pictureTest() { PixelState.getInstance().set_pictureBox(new PictureBox()); WebcamController target = WebcamController.getInstance(); PictureBox webcamPictureBox = new PictureBox(); WebcamOptions form = null; target.show_Webcam_picture(webcamPictureBox, form); }
public void getInstanceTest() { PictureBox pictureBox1 = new PictureBox(); PixelState.getInstance().set_pictureBox(pictureBox1); WebcamController expected = WebcamController.getInstance(); WebcamController actual; actual = null; Assert.AreNotEqual(expected, actual); }
public void registerTest() { PixelState p = PixelState.getInstance(); int threads = 0; // TODO: Passenden Wert initialisieren ThreadHandler target = new ThreadHandler(threads); // TODO: Passenden Wert initialisieren Thread thread = new Thread(p.reset); // TODO: Passenden Wert initialisieren target.register(thread); Assert.IsFalse(target.threadsAreAlive()); }
public void save_PixelStateTest() { int threads = 0; // TODO: Passenden Wert initialisieren ThreadHandler target = new ThreadHandler(threads); // TODO: Passenden Wert initialisieren Bitmap b = new Bitmap(10, 10); Image img = (Image)b; ImageManipulatorType.Name manipulator = ImageManipulatorType.Name.RGB_RED; // TODO: Passenden Wert initialisieren ImageObject imgO = new ImageObject(img, manipulator); target.save_PixelState(imgO); PixelState state = PixelState.getInstance(); Assert.IsInstanceOfType(state, typeof(PixelState)); }
public void show_pictureTest() { PictureBox pic = new PictureBox(); PixelState.getInstance().set_pictureBox(pic); WebcamModel target = new WebcamModel(); Dictionary <int, string> devices = new Dictionary <int, string>(); Dictionary <int, string> solutions = new Dictionary <int, string>(); devices.Add(1, ""); solutions.Add(1, ""); WebcamOptions form = new WebcamOptions(devices, solutions); target.show_picture(pic, form); }
public void addTest() { PixelState target = PixelState.getInstance(); Bitmap b = new Bitmap(10, 10); Image img = (Image)b; ImageObject imgObj = new ImageObject(img, ImageManipulatorType.Name.GRAYSCALE); I_ImageObject imgObj2 = target.get_last(); Assert.IsNotNull(imgObj2); target.add(imgObj); imgObj2 = target.get_last(); Assert.IsInstanceOfType(imgObj2, typeof(I_ImageObject)); Assert.IsNotNull(imgObj2); }
public void try_save_PixelStateTest() { ThreadHandler t = new ThreadHandler(2); PrivateObject param0 = new PrivateObject(t); ThreadHandler_Accessor target = new ThreadHandler_Accessor(param0); // TODO: Passenden Wert initialisieren Bitmap b = new Bitmap(10, 10); Image img = (Image)b; ImageManipulatorType.Name manipulator = ImageManipulatorType.Name.RGB_RED; // TODO: Passenden Wert initialisieren ImageObject imgO = new ImageObject(img, manipulator); target.try_save_PixelState(imgO); PixelState state = PixelState.getInstance(); Assert.IsInstanceOfType(state.get_last(), typeof(ImageObject)); Assert.IsNotNull(state.get_last()); }