コード例 #1
0
 public void testShouldExecutePostHandlerWhenEnemiesDoesNotContainSevenShouldReturnFalse() {
   // GIVEN
   expect(command.getEnemies()).andReturn(Arrays.asList("3", "75", "44"));
   mockControl.replay();
   // WHEN
   final boolean returned =
       underTest.shouldExecutePostHandler(command, resolvationData, results, data);
   // THEN
   Assert.assertFalse(returned);
 }
コード例 #2
0
 public void testShouldExecutePostHandlerWhenCaptainAttackStrengthTooLowShouldReturnFalse() {
   // GIVEN
   expect(command.getEnemies()).andReturn(Arrays.asList("7", "8"));
   final ImmutableMap<String, Integer> attackStrengths = ImmutableMap.of("7", 14, "8", 13);
   expect(command.getAttackStrengths()).andReturn(attackStrengths).times(2);
   mockControl.replay();
   // WHEN
   final boolean returned =
       underTest.shouldExecutePostHandler(command, resolvationData, results, data);
   // THEN
   Assert.assertFalse(returned);
 }
コード例 #3
0
 public void
     testShouldExecutePostHandlerWhenLostAgainstHighCaptainAttackStrengthShouldReturnTrue() {
   // GIVEN
   results = new FightRoundResult[] {FightRoundResult.LOSE, FightRoundResult.TIE};
   expect(command.getEnemies()).andReturn(Arrays.asList("7", "8"));
   final ImmutableMap<String, Integer> attackStrengths = ImmutableMap.of("7", 18, "8", 13);
   expect(command.getAttackStrengths()).andReturn(attackStrengths).times(2);
   mockControl.replay();
   // WHEN
   final boolean returned =
       underTest.shouldExecutePostHandler(command, resolvationData, results, data);
   // THEN
   Assert.assertTrue(returned);
 }