@Test public final void scissorsCutPaper() { Assert.assertEquals(RockPaper.WINPLAYERONE, this.GAME.play(RockPaper.SCISSORS, RockPaper.PAPER)); Assert.assertEquals(RockPaper.WINPLAYERTWO, this.GAME.play(RockPaper.PAPER, RockPaper.SCISSORS)); }
public final int play(final String playerOne, final String playerTwo) { int response = DRAW; if (isDraw(playerOne, playerTwo)) { response = DRAW; } else if (PAPER.equals(playerOne)) { return checkPaperRulesPlayerOne(playerTwo); } else if (ROCK.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERTWO; } else if (SCISSORS.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERONE; } else if (ROCK.equals(playerOne) && LIZZARD.equals(playerTwo)) { response = WINPLAYERONE; } else if (LIZZARD.equals(playerOne) && ROCK.equals(playerTwo)) { response = WINPLAYERTWO; } else if (SPOCK.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERTWO; } return response; }
RockPaper { public final int play(final String playerOne, final String playerTwo) { int response = DRAW; if (isDraw(playerOne, playerTwo)) { response = DRAW; } else if (PAPER.equals(playerOne)) { return checkPaperRulesPlayerOne(playerTwo); } else if (ROCK.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERTWO; } else if (SCISSORS.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERONE; } else if (ROCK.equals(playerOne) && LIZZARD.equals(playerTwo)) { response = WINPLAYERONE; } else if (LIZZARD.equals(playerOne) && ROCK.equals(playerTwo)) { response = WINPLAYERTWO; } else if (SPOCK.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERTWO; } return response; } }
RockPaper { public final int play(final String playerOne, final String playerTwo) { int response = DRAW; if (isDraw(playerOne, playerTwo)) { response = DRAW; } else if (PAPER.equals(playerOne)) { return checkPaperRulesPlayerOne(playerTwo); } else if (ROCK.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERTWO; } else if (SCISSORS.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERONE; } else if (ROCK.equals(playerOne) && LIZZARD.equals(playerTwo)) { response = WINPLAYERONE; } else if (LIZZARD.equals(playerOne) && ROCK.equals(playerTwo)) { response = WINPLAYERTWO; } else if (SPOCK.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERTWO; } return response; }  }
RockPaper { public final int play(final String playerOne, final String playerTwo) { int response = DRAW; if (isDraw(playerOne, playerTwo)) { response = DRAW; } else if (PAPER.equals(playerOne)) { return checkPaperRulesPlayerOne(playerTwo); } else if (ROCK.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERTWO; } else if (SCISSORS.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERONE; } else if (ROCK.equals(playerOne) && LIZZARD.equals(playerTwo)) { response = WINPLAYERONE; } else if (LIZZARD.equals(playerOne) && ROCK.equals(playerTwo)) { response = WINPLAYERTWO; } else if (SPOCK.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERTWO; } return response; }  final int play(final String playerOne, final String playerTwo); }
RockPaper { public final int play(final String playerOne, final String playerTwo) { int response = DRAW; if (isDraw(playerOne, playerTwo)) { response = DRAW; } else if (PAPER.equals(playerOne)) { return checkPaperRulesPlayerOne(playerTwo); } else if (ROCK.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERTWO; } else if (SCISSORS.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERONE; } else if (ROCK.equals(playerOne) && LIZZARD.equals(playerTwo)) { response = WINPLAYERONE; } else if (LIZZARD.equals(playerOne) && ROCK.equals(playerTwo)) { response = WINPLAYERTWO; } else if (SPOCK.equals(playerOne) && PAPER.equals(playerTwo)) { response = WINPLAYERTWO; } return response; }  final int play(final String playerOne, final String playerTwo); static final int DRAW; static final int WINPLAYERONE; static final int WINPLAYERTWO; static final String SPOCK; static final String LIZZARD; static final String ROCK; static final String PAPER; static final String SCISSORS; }