1 29 30 package nextapp.echo2.app.test; 31 32 import nextapp.echo2.app.Color; 33 import junit.framework.TestCase; 34 35 39 public class ColorTest extends TestCase { 40 41 44 public void testEquals() { 45 assertEquals(Color.RED, new Color(0xff0000)); 46 assertFalse(Color.RED.equals(new Color(0xfe0000))); 47 } 48 49 52 public void testConstructorCombined() { 53 Color color = new Color(0xabcdef); 54 assertEquals(color.getRed(), 0xab); 55 assertEquals(color.getGreen(), 0xcd); 56 assertEquals(color.getBlue(), 0xef); 57 } 58 59 62 public void testConstructorIndependent() { 63 Color color = new Color(0xab, 0xcd, 0xef); 64 assertEquals(color.getRed(), 0xab); 65 assertEquals(color.getGreen(), 0xcd); 66 assertEquals(color.getBlue(), 0xef); 67 } 68 } 69 | Popular Tags |