@Test public void shouldDefaultToXGoesFirst(){ when(preferenceHelper.getPreference(eq(GamePreference.PREF_TURN.getKey()), eq(GameSymbol.X.getId()))).thenReturn(GameSymbol.X.getId()); GameSymbol turn = toeGame.getTurn(); assertEquals(GameSymbol.X, turn); }
public GameSymbol getTurn(){ return GameSymbol.byId(preferenceHelper.getPreference(GamePreference.PREF_TURN.getKey(), GameSymbol.X.getId())); }
ToeGame { public GameSymbol getTurn(){ return GameSymbol.byId(preferenceHelper.getPreference(GamePreference.PREF_TURN.getKey(), GameSymbol.X.getId())); } }
ToeGame { public GameSymbol getTurn(){ return GameSymbol.byId(preferenceHelper.getPreference(GamePreference.PREF_TURN.getKey(), GameSymbol.X.getId())); } @Inject  ToeGame(PreferenceHelper preferenceHelper); }
ToeGame { public GameSymbol getTurn(){ return GameSymbol.byId(preferenceHelper.getPreference(GamePreference.PREF_TURN.getKey(), GameSymbol.X.getId())); } @Inject  ToeGame(PreferenceHelper preferenceHelper); String titleHack(String appName, String statusMessage); void setSkill(Skill skill); void setNumOfPlayers(int numOfPlayers); Skill getSkill(); int getNumOfPlayers(); void setTurn(GameSymbol gameSymbol); GameSymbol getTurn(); boolean inProgress(); void setGameOver(); void setGameInProgess(); void advanceTurn(GameSymbol gameSymbol); void chooseBox(ContentResolver contentResolver, ToeStrategy strategy); void reset(ContentResolver contentResolver); boolean isOnePlayerGame(); boolean symbolIsAndroid(GameSymbol symbol); boolean isAndroidTurn(); void generateAndroidTurn(ContentResolver contentResolver, int[] selectedXBoxIds, int[] selectedOBoxIds); }
ToeGame { public GameSymbol getTurn(){ return GameSymbol.byId(preferenceHelper.getPreference(GamePreference.PREF_TURN.getKey(), GameSymbol.X.getId())); } @Inject  ToeGame(PreferenceHelper preferenceHelper); String titleHack(String appName, String statusMessage); void setSkill(Skill skill); void setNumOfPlayers(int numOfPlayers); Skill getSkill(); int getNumOfPlayers(); void setTurn(GameSymbol gameSymbol); GameSymbol getTurn(); boolean inProgress(); void setGameOver(); void setGameInProgess(); void advanceTurn(GameSymbol gameSymbol); void chooseBox(ContentResolver contentResolver, ToeStrategy strategy); void reset(ContentResolver contentResolver); boolean isOnePlayerGame(); boolean symbolIsAndroid(GameSymbol symbol); boolean isAndroidTurn(); void generateAndroidTurn(ContentResolver contentResolver, int[] selectedXBoxIds, int[] selectedOBoxIds);  }