Exemplo n.º 1
0
        public void NewAndDelete()
        {
            int width  = 21;
            int height = 128;

            var images = new ImageList();
            int count  = images.Count;

            var image = new Image(width, height, ImageBaseType.Rgb)
            {
                { new Layer("test", ImageType.Rgb), 0 }
            };

            Assert.AreEqual(count, images.Count);

            var display = new Display(image);

            images.Refresh();
            Assert.AreEqual(count + 1, images.Count);

            display.Delete();
            images.Refresh();

            /// Todo: the next assert fails! The number of images is still the same.
            Assert.AreEqual(count, images.Count);
            image.Delete();
        }
Exemplo n.º 2
0
        public void IsValid()
        {
            int width = 21;
              int height = 128;

              var image = new Image(width, height, ImageBaseType.Rgb) {
            {new Layer("test", ImageType.Rgb), 0}};

              var display = new Display(image);
              Assert.IsTrue(display.Valid);

              display.Delete();
              image.Delete();
              Display.DisplaysFlush();
              Assert.IsFalse(display.Valid);
        }
Exemplo n.º 3
0
        public void IsValid()
        {
            int width  = 21;
            int height = 128;

            var image = new Image(width, height, ImageBaseType.Rgb)
            {
                { new Layer("test", ImageType.Rgb), 0 }
            };

            var display = new Display(image);

            Assert.IsTrue(display.Valid);

            display.Delete();
            image.Delete();
            Display.DisplaysFlush();
            Assert.IsFalse(display.Valid);
        }
Exemplo n.º 4
0
        public void Reconnect()
        {
            int width    = 21;
            int height   = 128;
            var oldImage = new Image(width, height, ImageBaseType.Rgb)
            {
                { new Layer("test", ImageType.Rgb), 0 }
            };
            var newImage = new Image(width, height, ImageBaseType.Rgb)
            {
                { new Layer("test", ImageType.Rgb), 0 }
            };

            Assert.IsFalse(Display.Reconnect(oldImage, newImage));

            var display = new Display(oldImage);

            Assert.IsFalse(Display.Reconnect(newImage, oldImage));
            Assert.IsTrue(Display.Reconnect(oldImage, newImage));

            display.Delete();
        }
Exemplo n.º 5
0
        public void NewAndDelete()
        {
            int width = 21;
              int height = 128;

              var images = new ImageList();
              int count = images.Count;

              var image = new Image(width, height, ImageBaseType.Rgb) {
            {new Layer("test", ImageType.Rgb), 0}};

              Assert.AreEqual(count, images.Count);

              var display = new Display(image);
              images.Refresh();
              Assert.AreEqual(count + 1, images.Count);

              display.Delete();
              images.Refresh();

              /// Todo: the next assert fails! The number of images is still the same.
              Assert.AreEqual(count, images.Count);
              image.Delete();
        }
Exemplo n.º 6
0
        public void Reconnect()
        {
            int width = 21;
              int height = 128;
              var oldImage = new Image(width, height, ImageBaseType.Rgb) {
            {new Layer("test", ImageType.Rgb), 0}};
              var newImage = new Image(width, height, ImageBaseType.Rgb) {
            {new Layer("test", ImageType.Rgb), 0}};

              Assert.IsFalse(Display.Reconnect(oldImage, newImage));

              var display = new Display(oldImage);

              Assert.IsFalse(Display.Reconnect(newImage, oldImage));
              Assert.IsTrue(Display.Reconnect(oldImage, newImage));

              display.Delete();
        }