Skip to content
Permalink
Browse files
Partially Transition
  • Loading branch information
ClayDowling committed Apr 15, 2017
1 parent 4077b27 commit 565fd5ce0d106206ce0a29b2fa057570925b1926
Showing 2 changed files with 10 additions and 6 deletions.
@@ -12,4 +12,8 @@ The first step is defining an interface which encapsulates the actions I am inte

## Implement Interface

Next I implement the interface, without changing the classes which access the board object. All my tests are still green and I could push to master without breaking things.
Next I implement the interface, without changing the classes which access the board object. All my tests are still green and I could push to master without breaking things.

## Partially Transition

I have partially transitions to using the new interface, in the tests for LifeBoard. The tests for Engine still use the old interface, but everything compiles and I can push to master without causing a riot.
@@ -19,26 +19,26 @@ public void setUp() {

@Test
public void clear_byDefault_setsAllValuesToFalse() {
board.value[10][10] = true;
board.set(10, 10, 1);
board.clear();
assertThat(board.value[10][10], is(false));
assertThat(board.at(10,10), is(0));
}

@Test
public void at_forATrueCell_returnsOne() {
board.value[10][10] = true;
board.set(10, 10, 1);
assertThat(board.at(10, 10), is(1));
}

@Test
public void at_forFalseCell_returnsZero() {
board.value[10][10] = false;
board.set(10, 10, 0);
assertThat(board.at(10, 10), is(0));
}

@Test
public void set_givenZero_willReturnZeroFromAt() {
board.value[10][10] = true;
board.set(10, 10, 1);
board.set(10, 10, 0);
assertThat(board.at(10, 10), is(0));
}

0 comments on commit 565fd5c

Please sign in to comment.