public void AddEntry() { var palette = new Palette("UnitTestPalette"); palette.AddEntry("black", new RGB(0, 0, 0)); Assert.AreEqual(palette.NumberOfColors, 1); palette.Delete(); }
public void GetInfo() { var palette = new Palette("UnitTestPalette"); int num_colors; palette.GetInfo(out num_colors); Assert.AreEqual(num_colors, 0); palette.Delete(); }
public void Rename() { var palette = new Palette("UnitTestPalette"); string name = palette.Rename("UnitTestPaletteTwo"); Assert.AreEqual(name, "UnitTestPaletteTwo"); Assert.IsTrue(palette.Name == "UnitTestPaletteTwo"); palette.Delete(); }
public void This() { var palette = new Palette("UnitTestPalette"); palette.AddEntry("black", new RGB(0, 0, 0)); var black = palette[0]; Assert.IsNotNull(black); palette.Delete(); }
public void NewPalette() { var palettes = new PaletteList(null); int count = palettes.Count; var palette = new Palette("UnitTestPalette"); palettes = new PaletteList(null); Assert.AreEqual(count + 1, palettes.Count); palette.Delete(); }
public void GetEnumerator() { var palette = new Palette("UnitTestPalette"); palette.AddEntry("black", new RGB(0, 0, 0)); int count = 0; foreach (var entry in palette) { count++; Assert.AreEqual(entry.Name, "black"); } Assert.AreEqual(count, 1); palette.Delete(); }
public void ThisOutOfRange() { var palette = new Palette("UnitTestPalette"); palette.AddEntry("black", new RGB(0, 0, 0)); // TODO: no range check yet var white = palette[1]; try { string name = white.Name; } catch { palette.Delete(); throw; } }