gnorsilva/201306_lscc_hands_on — pull request #1 by ataulm (2013-07-01 21:47:23+00:00)
Title: Add new test

I've added one (and a half) new tests. After the first new test added, I noticed a non-optimal way of retrieving score - can I refactor here, or is it only when I get to point where I'm stuck by a failing test that I should change the design?

I want to replace:

public int playerOnePoints() {
return playerOnePoints;
}

public int playerTwoPoints() {
return playerTwoPoints;
}

with:

public int getPoints(Player player) {
if (player == Player.ONE) {
return playerOnePoints;
}
return playerTwoPoints;
}

1. Is that against TDD (purist vs. relaxed)? If it's against (even purist), then it could be argued that you'd never be blocked by that, it's just going to get annoying, especially in that it's difficult to scale up (to more players for example).
1. If I can do this, then in IDEA, is there a way for me to refactor such that anywhere `playerOnePoints()` is called, I can change it to `getPoints(Player.ONE)` (and likewise for `Player.TWO`) or is it a case of find/replace?
1. I have another test lined up, but wasn't sure how to write it without mocking Match (and should you have both a mock `Match` and concrete `Match` in same test class?)