Skip to content

Commit 565fd5c

Browse files
committed
Partially Transition
1 parent 4077b27 commit 565fd5c

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ The first step is defining an interface which encapsulates the actions I am inte
1212

1313
## Implement Interface
1414

15-
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.
15+
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.
16+
17+
## Partially Transition
18+
19+
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.

src/test/java/LifeBoardTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@ public void setUp() {
1919

2020
@Test
2121
public void clear_byDefault_setsAllValuesToFalse() {
22-
board.value[10][10] = true;
22+
board.set(10, 10, 1);
2323
board.clear();
24-
assertThat(board.value[10][10], is(false));
24+
assertThat(board.at(10,10), is(0));
2525
}
2626

2727
@Test
2828
public void at_forATrueCell_returnsOne() {
29-
board.value[10][10] = true;
29+
board.set(10, 10, 1);
3030
assertThat(board.at(10, 10), is(1));
3131
}
3232

3333
@Test
3434
public void at_forFalseCell_returnsZero() {
35-
board.value[10][10] = false;
35+
board.set(10, 10, 0);
3636
assertThat(board.at(10, 10), is(0));
3737
}
3838

3939
@Test
4040
public void set_givenZero_willReturnZeroFromAt() {
41-
board.value[10][10] = true;
41+
board.set(10, 10, 1);
4242
board.set(10, 10, 0);
4343
assertThat(board.at(10, 10), is(0));
4444
}

0 commit comments

Comments
 (0)