GameController implements IModelChangedListener, Parcelable { public void selectCell(int row, int col) { if(selectedValue != 0) { if(noteStatus) { toggleNote(row, col, selectedValue); } else { setValue(row, col, selectedValue); } undoRedoManager.addState(gameBoard); } else if(selectedRow == row && selectedCol == col) { selectedRow = -1; selectedCol = -1; highlightValue = 0; } else { selectedRow = row; selectedCol = col; int v = getGameCell(row, col).getValue(); if(v != 0) { highlightValue = v; } } notifyHighlightChangedListeners(); } GameController();  GameController(SharedPreferences pref, Context context);  GameController(GameType type, SharedPreferences pref, Context context); private  GameController(Parcel in); int getGameID(); boolean gameIsCustom(); void loadNewLevel(GameType type, GameDifficulty difficulty); void loadNewDailySudokuLevel(); int getTime(); void loadLevel(GameInfoContainer gic); void setSettings(SharedPreferences pref); int[] solve(); void hint(); GameCell getGameCell(int row, int col); boolean isSolved(); void setValue(int row, int col, int value); LinkedList<GameCell> getConnectedCells(int row, int col); void deleteNotes(List<GameCell> updateList, int value); int getValue(int row, int col); GameType getGameType(); T actionOnCells(ICellAction<T> ca, T existing); boolean checkIfBoardIsFilled(); void saveGame(Context context); void saveDailySudoku(Context context); void deleteGame(Context context); GameInfoContainer getInfoContainer(); int getSize(); boolean isValidNumber(int val); CellConflictList getErrorList(); void resetLevel(); boolean deleteValue(int row, int col); void setNote(int row, int col, int value); boolean[] getNotes(int row, int col); GameDifficulty getDifficulty(); void deleteNote(int row, int col, int value); void toggleNote(int row, int col, int value); String getFieldAsString(); String getCodeOfField(); int getSelectedRow(); int getSelectedCol(); int getSelectedCellsValue(); int getSelectedValue(); void selectCell(int row, int col); int getHighlightedValue(); boolean isValueHighlighted(); void selectValue(int value); void setNoteStatus(boolean enabled); boolean getNoteStatus(); void deleteSelectedCellsValue(); void toggleSelectedCellsNote(int value); boolean isValidCellSelected(); int getSectionHeight(); int getSectionWidth(); @Override void onModelChange(GameCell c); void checkErrorList(); void resetSelects(); void registerGameSolvedListener(IGameSolvedListener l); void registerHighlightChangedListener(IHighlightChangedListener l); void removeGameSolvedListener(IGameSolvedListener l); void notifyHighlightChangedListeners(); void notifySolvedListeners(); void notifyTimerListener(int time); void registerTimerListener(ITimerListener listener); void notifyHintListener(); void registerHintListener(IHintListener listener); int getUsedHints(); void resetTime(); void initTimer(); void deleteTimer(); void startTimer(); void pauseTimer(); void ReDo(); void UnDo(); boolean isRedoAvailable(); boolean isUndoAvailable(); void updateGameBoard(final GameBoard gameBoard); int getValueCount(final int value); @Override int describeContents(); @Override void writeToParcel(Parcel out, int flags); void removeAllListeners(); void setContextAndSettings(Context applicationContext, SharedPreferences sharedPref); static final int DAILY_SUDOKU_ID; static final Parcelable.Creator<GameController> CREATOR; }
@Test public void selectCellTest() { controller.selectCell(0, 1); assertEquals(1, controller.getSelectedCol()); assertEquals(0, controller.getSelectedRow()); }