Test the function of adding an ability multiple times which has a single choice and adds a static bonus. @throws Exception
()
| 244 | * @throws Exception |
| 245 | */ |
| 246 | @Test |
| 247 | public void testNoSubsChoiceBonus() throws Exception |
| 248 | { |
| 249 | CampaignSourceEntry source; |
| 250 | try |
| 251 | { |
| 252 | source = new CampaignSourceEntry(new Campaign(), |
| 253 | new URI("file:/" + getClass().getName() + ".java")); |
| 254 | } |
| 255 | catch (URISyntaxException e) |
| 256 | { |
| 257 | throw new UnreachableError(e); |
| 258 | } |
| 259 | AbilityLoader loader = new AbilityLoader(); |
| 260 | loader |
| 261 | .parseLine( |
| 262 | Globals.getContext(), |
| 263 | null, |
| 264 | "Toughness CATEGORY:FEAT TYPE:General STACK:YES " |
| 265 | + "MULT:YES CHOOSE:NOCHOICE BONUS:HP|CURRENTMAX|3", source); |
| 266 | Ability pObj = Globals.getContext().getReferenceContext() |
| 267 | .getManufacturerId(BuildUtilities.getFeatCat()).getActiveObject("Toughness"); |
| 268 | PlayerCharacter aPC = getCharacter(); |
| 269 | int baseHP = aPC.hitPoints(); |
| 270 | AbstractCharacterTestCase.applyAbility(aPC, BuildUtilities.getFeatCat(), pObj, ""); |
| 271 | aPC.calcActiveBonuses(); |
| 272 | assertEquals("Should have added 3 HPs", baseHP + 3, aPC.hitPoints()); |
| 273 | |
| 274 | AbstractCharacterTestCase.applyAbility(aPC, BuildUtilities.getFeatCat(), pObj, ""); |
| 275 | aPC.calcActiveBonuses(); |
| 276 | assertEquals("2 instances should have added 6 HPs", baseHP + 6, aPC |
| 277 | .hitPoints()); |
| 278 | |
| 279 | } |
| 280 | |
| 281 | /** |
| 282 | * Tests description handling |
nothing calls this directly
no test coverage detected