Permalink
Browse files

add setGroup/getGroup method

  • Loading branch information...
1 parent ce5b89a commit b8949f29f8707feb33a245195627fe6bb0e253c3 @cad-san committed Mar 18, 2012
@@ -5,6 +5,7 @@
public static final String DeadCell = "DEAD";
private String status = DeadCell;
+ private int group;
public Cell(String status)
{
@@ -20,4 +21,13 @@ public String toString() {
public boolean equals(Object another) {
return status.equals(another);
}
+
+ public void setGroup(int group) {
+ this.group = group;
+ }
+
+ public int getGroup() {
+ return group;
+ }
+
}
@@ -16,4 +16,11 @@ public void testInitDead() throws Exception {
assertEquals("DEAD", cell.toString());
assertTrue(cell.equals(Cell.DeadCell));
}
+
+ public void testGroupArive() throws Exception {
+ Cell cell = new Cell(Cell.AliveCell);
+ cell.setGroup(1);
+ assertEquals(1, cell.getGroup());
+ }
+
}

0 comments on commit b8949f2

Please sign in to comment.