Exemplo n.º 1
0
  @Test
  public void testDeadToDeadTranistion() {
    DeadState state = new DeadState();
    ICell fourLiveNeighbour = StateTestUtils.getCellWithNLiveAndMDeadNebhours(4, 0, false);
    ICell twoLiveNeighbour = StateTestUtils.getCellWithNLiveAndMDeadNebhours(0, 4, false);

    CellState fourLiveNeighbourResult = state.nextState(fourLiveNeighbour);
    CellState twoLiveNeighbourNeighbourResult = state.nextState(twoLiveNeighbour);

    assertEquals(state, fourLiveNeighbourResult);
    assertEquals(state, twoLiveNeighbourNeighbourResult);
  }
Exemplo n.º 2
0
 @Test
 public void testDeadToLiveTranistion() {
   LiveState state = new LiveState();
   CellState result =
       state.nextState(StateTestUtils.getCellWithNLiveAndMDeadNebhours(3, 0, false));
   assertEquals(state, result);
 }