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); }
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(); }
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(); }
static public void DisplaysFlush() { Display.DisplaysFlush(); }