Skip to content

Commit

Permalink
Partially Transition
Browse files Browse the repository at this point in the history
  • Loading branch information
ClayDowling committed Apr 15, 2017
1 parent 4077b27 commit 565fd5c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 5 additions & 5 deletions src/test/java/LifeBoardTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 565fd5c

Please sign in to comment.