1 29 30 package nextapp.echo2.app.test; 31 32 import junit.framework.TestCase; 33 34 import nextapp.echo2.app.Grid; 35 36 39 public class GridTest extends TestCase { 40 41 44 public void testDefaults() { 45 Grid grid = new Grid(); 46 assertEquals(Grid.ORIENTATION_HORIZONTAL, grid.getOrientation()); 47 assertEquals(2, grid.getSize()); 48 } 49 50 53 public void testProperties() { 54 Grid grid = new Grid(); 55 grid.setBorder(TestConstants.BORDER_THICK_ORANGE); 56 grid.setInsets(TestConstants.INSETS_1234); 57 grid.setOrientation(Grid.ORIENTATION_VERTICAL); 58 grid.setSize(5); 59 grid.setWidth(TestConstants.EXTENT_50_PERCENT); 60 grid.setHeight(TestConstants.EXTENT_500_PX); 61 grid.setColumnWidth(0, TestConstants.EXTENT_100_PX); 62 grid.setColumnWidth(1, TestConstants.EXTENT_200_PX); 63 grid.setRowHeight(0, TestConstants.EXTENT_30_PX); 64 grid.setRowHeight(1, TestConstants.EXTENT_500_PX); 65 assertEquals(TestConstants.BORDER_THICK_ORANGE, grid.getBorder()); 66 assertEquals(TestConstants.INSETS_1234, grid.getInsets()); 67 assertEquals(Grid.ORIENTATION_VERTICAL, grid.getOrientation()); 68 assertEquals(5, grid.getSize()); 69 assertEquals(TestConstants.EXTENT_50_PERCENT, grid.getWidth()); 70 assertEquals(TestConstants.EXTENT_500_PX, grid.getHeight()); 71 assertEquals(TestConstants.EXTENT_100_PX, grid.getColumnWidth(0)); 72 assertEquals(TestConstants.EXTENT_200_PX, grid.getColumnWidth(1)); 73 assertEquals(TestConstants.EXTENT_30_PX, grid.getRowHeight(0)); 74 assertEquals(TestConstants.EXTENT_500_PX, grid.getRowHeight(1)); 75 } 76 } 77 | Popular Tags |