Exemplo n.º 1
0
        public void TestEnumerator()
        {
            var image1 = CreateImage();
              var image2 = CreateImage();

              int count = 0;
              var images = new ImageList();
              foreach (var image in images)
            {
              count++;
            }
              Assert.AreEqual(images.Count, count);

              image2.Delete();
              image1.Delete();
        }
Exemplo n.º 2
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.º 3
0
        public void TestConstructor()
        {
            var images = new ImageList();

            Assert.AreEqual(1, images.Count);
        }
Exemplo n.º 4
0
        public void TestGetIndex()
        {
            var images = new ImageList();

            Assert.AreEqual(0, images.GetIndex(_image));
        }
Exemplo n.º 5
0
        public void TestThis()
        {
            var images = new ImageList();

            Assert.AreEqual(_image, images[0]);
        }
Exemplo n.º 6
0
        public void TestForEach()
        {
            var image1 = CreateImage();
              var image2 = CreateImage();

              int count = 0;
              var images = new ImageList();

              images.ForEach(image => count++);
              Assert.AreEqual(images.Count, count);

              image2.Delete();
              image1.Delete();
        }
Exemplo n.º 7
0
 public void TestConstructor()
 {
     var images = new ImageList();
       Assert.AreEqual(1, images.Count);
 }
Exemplo n.º 8
0
 public void TestThis()
 {
     var images = new ImageList();
       Assert.AreEqual(_image, images[0]);
 }
Exemplo n.º 9
0
        public void TestRefresh()
        {
            var images = new ImageList();
              int count = images.Count;
              var image = CreateImage();

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

              image.Delete();
        }
Exemplo n.º 10
0
 public void TestGetIndex()
 {
     var images = new ImageList();
       Assert.AreEqual(0, images.GetIndex(_image));
 }