public void ImageObjectConstructorTest()
        {
            Bitmap b   = new Bitmap(10, 10);
            Image  img = (Image)b;

            ImageManipulatorType.Name manipulator = ImageManipulatorType.Name.RGB_RED;  // TODO: Passenden Wert initialisieren
            ImageObject target = new ImageObject(img, manipulator);

            Assert.AreEqual(target.get_ImageManipulatorType(), ImageManipulatorType.Name.RGB_RED);
            Assert.AreSame(target.get_Image(), img);
            Assert.IsInstanceOfType(target.get_Image(), typeof(Image));
        }
Beispiel #2
0
        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 get_ImageTest()
        {
            Bitmap b   = new Bitmap(10, 10);
            Image  img = (Image)b;

            ImageManipulatorType.Name manipulator = ImageManipulatorType.Name.RGB_RED; // TODO: Passenden Wert initialisieren
            ImageObject target = new ImageObject(img, manipulator);                    // TODO: Passenden Wert initialisieren

            Image actual = target.get_Image();

            Assert.IsNotNull(actual);
            Assert.IsInstanceOfType(actual, typeof(Image));
        }