示例#1
0
 @Test
 public void TestSetCellAt() {
   System.out.println("setCellAt");
   instance.setCellAt("X", 0, 0);
   Object expResult = "X";
   Object result = ((ImageIcon) instance.getValueAt(0, 0)).getDescription();
   assertEquals(expResult, result);
 }
示例#2
0
 @Test
 public void testGetInverse() {
   System.out.println("getInverse");
   instance.setCellAt("X", 0, 2);
   instance.setCellAt("O", 1, 1);
   String expResult = "XO ";
   String result = instance.getInverse();
   assertEquals(expResult, result);
 }
示例#3
0
  @Test
  public void testClear() {
    System.out.println("clear");
    instance.setCellAt("X", 0, 0);

    Object expResult = null;
    instance.clear();
    Object result = instance.getCellAt(0, 0);
    assertEquals(expResult, result);
  }
示例#4
0
 @Test
 public void testGetColumn() {
   System.out.println("getColumn");
   int j = 0;
   instance.setCellAt("X", 0, j);
   instance.setCellAt("O", 1, j);
   String expResult = "XO ";
   String result = instance.getColumn(j);
   assertEquals(expResult, result);
 }
示例#5
0
 @Test
 public void testGetRow() {
   System.out.println("getRow");
   int i = 0;
   instance.setCellAt("X", i, 0);
   instance.setCellAt("O", i, 1);
   String expResult = "XO ";
   String result = instance.getRow(i);
   assertEquals(expResult, result);
 }
示例#6
0
 @Test
 public void testTableIsFull() {
   System.out.println("tableIsFull");
   int count = instance.getRowCount();
   for (int i = 0; i < count; i++) {
     for (int j = 0; j < count; j++) {
       instance.setCellAt("X", i, j);
     }
   }
   boolean result = instance.tableIsFull();
   assertTrue(result);
 }