@Test public void ex2_endMatch() throws MatchException { MatchData match = test.newMatch(ID); assertNotNull(match); MatchData data = test.endMatch(); assertTrue(test.getCurrentMathData().getId().equals(UNKNOWN_MATCH)); assertTrue(data.getId().equals(ID)); }
@Test public void ex1_startMatch() throws MatchException { MatchData match = test.newMatch(ID); assertNotNull(match); MatchData match2 = test.getCurrentMathData(); assertNotNull(match2); assertTrue(match.equals(match2)); }
@Test public void ex2_endMatchConsolidate() throws MatchException { MatchData match = test.newMatch(ID); insertPlayers(match); insertWeapons(match); MatchData data = test.endMatch(); MatchPlayers player = data.getPlayers().iterator().next(); assertTrue(player.getBestWeapon().getName().equals("weapon4")); assertTrue(player.getName().equals("Name4")); assertTrue(player.isAward()); }
@Test(expected = MatchException.class) public void ex1_wrongID() throws MatchException { test.newMatch(""); }