1 package net.sourceforge.jwebunit; 2 3 import junit.framework.TestCase; 4 5 8 public class ExpectedTableTest extends TestCase { 9 10 public ExpectedTableTest(String s) { 11 super(s); 12 } 13 14 17 public void testConstructionWithStrings() { 18 ExpectedTable table = new ExpectedTable(new Object [][] 19 {{"1_1", "1_2"},{"2_1", "2_2"}}); 20 assertEquals(table.toString(), "{{1_1}{1_2}}{{2_1}{2_2}}"); 21 } 22 23 27 public void testConstructionWithExpectedCell() { 28 ExpectedTable table = new ExpectedTable(new Object [][] 29 { {"1_1", "1_2", "1_3"}, {"2_1", new ExpectedCell("2_2-3",2)} } ); 30 assertEquals(table.toString(), "{{1_1}{1_2}{1_3}}{{2_1}{2_2-3}{2_2-3}}"); 31 } 32 33 37 public void testAppendRows() { 38 ExpectedTable table = new ExpectedTable(new Object [][] 39 {{"1_1", "1_2"},{"2_1", "2_2"}}); 40 table.appendRows(new Object [][] {{"3_1"}}); 41 assertEquals(table.toString(), "{{1_1}{1_2}}{{2_1}{2_2}}{{3_1}}"); 42 } 43 44 public void testAppendTables() { 45 ExpectedTable table = new ExpectedTable(new Object [][] 46 {{"1_1", "1_2"},{"2_1", "2_2"}}); 47 table.appendRows(new ExpectedTable(new Object [][]{{"3_1"}})); 48 assertEquals(table.toString(), "{{1_1}{1_2}}{{2_1}{2_2}}{{3_1}}"); 49 } 50 51 } 52 | Popular Tags |