Example #1
0
 public void AddEntry()
 {
     var palette = new Palette("UnitTestPalette");
       palette.AddEntry("black", new RGB(0, 0, 0));
       Assert.AreEqual(palette.NumberOfColors, 1);
       palette.Delete();
 }
Example #2
0
 public void GetInfo()
 {
     var palette = new Palette("UnitTestPalette");
       int num_colors;
       palette.GetInfo(out num_colors);
       Assert.AreEqual(num_colors, 0);
       palette.Delete();
 }
Example #3
0
        public void AddEntry()
        {
            var palette = new Palette("UnitTestPalette");

            palette.AddEntry("black", new RGB(0, 0, 0));
            Assert.AreEqual(palette.NumberOfColors, 1);
            palette.Delete();
        }
Example #4
0
        public void GetInfo()
        {
            var palette = new Palette("UnitTestPalette");
            int num_colors;

            palette.GetInfo(out num_colors);
            Assert.AreEqual(num_colors, 0);
            palette.Delete();
        }
Example #5
0
        public void Rename()
        {
            var    palette = new Palette("UnitTestPalette");
            string name    = palette.Rename("UnitTestPaletteTwo");

            Assert.AreEqual(name, "UnitTestPaletteTwo");
            Assert.IsTrue(palette.Name == "UnitTestPaletteTwo");
            palette.Delete();
        }
Example #6
0
        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();
        }
Example #7
0
        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();
        }
Example #8
0
 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();
 }
Example #9
0
        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();
        }
Example #10
0
        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;
            }
        }
Example #11
0
 public void Rename()
 {
     var palette = new Palette("UnitTestPalette");
       string name = palette.Rename("UnitTestPaletteTwo");
       Assert.AreEqual(name, "UnitTestPaletteTwo");
       Assert.IsTrue(palette.Name == "UnitTestPaletteTwo");
       palette.Delete();
 }
Example #12
0
 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();
 }
Example #13
0
 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;
       }
 }
Example #14
0
 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();
 }