Test the function of adding an ability multiple times which has no choices and adds a static bonus. @throws Exception
()
| 202 | * @throws Exception |
| 203 | */ |
| 204 | @Test |
| 205 | public void testNoChoiceBonus() throws Exception |
| 206 | { |
| 207 | CampaignSourceEntry source; |
| 208 | try |
| 209 | { |
| 210 | source = new CampaignSourceEntry(new Campaign(), |
| 211 | new URI("file:/" + getClass().getName() + ".java")); |
| 212 | } |
| 213 | catch (URISyntaxException e) |
| 214 | { |
| 215 | throw new UnreachableError(e); |
| 216 | } |
| 217 | AbilityLoader loader = new AbilityLoader(); |
| 218 | loader |
| 219 | .parseLine( |
| 220 | Globals.getContext(), |
| 221 | null, |
| 222 | "Toughness CATEGORY:FEAT TYPE:General STACK:YES " |
| 223 | + "MULT:YES CHOOSE:NOCHOICE BONUS:HP|CURRENTMAX|3", source); |
| 224 | |
| 225 | Ability pObj = Globals.getContext().getReferenceContext() |
| 226 | .getManufacturerId(BuildUtilities.getFeatCat()).getActiveObject("Toughness"); |
| 227 | Globals.getContext().getReferenceContext().constructCDOMObject(Language.class, "Foo"); |
| 228 | PlayerCharacter aPC = getCharacter(); |
| 229 | int baseHP = aPC.hitPoints(); |
| 230 | AbstractCharacterTestCase.applyAbility(aPC, BuildUtilities.getFeatCat(), pObj, ""); |
| 231 | aPC.calcActiveBonuses(); |
| 232 | assertEquals("Should have added 3 HPs", baseHP + 3, aPC.hitPoints()); |
| 233 | |
| 234 | AbstractCharacterTestCase.applyAbility(aPC, BuildUtilities.getFeatCat(), pObj, ""); |
| 235 | aPC.calcActiveBonuses(); |
| 236 | assertEquals("2 instances should have added 6 HPs", baseHP + 6, aPC |
| 237 | .hitPoints()); |
| 238 | |
| 239 | } |
| 240 | |
| 241 | /** |
| 242 | * Test the function of adding an ability multiple times which has |
nothing calls this directly
no test coverage detected