MCPcopy Create free account
hub / github.com/PCGen/pcgen / testDescription

Method testDescription

code/src/test/pcgen/core/PObjectTest.java:284–312  ·  view source on GitHub ↗

Tests description handling

()

Source from the content-addressed store, hash-verified

282 * Tests description handling
283 */
284 @Test
285 public void testDescription()
286 {
287 final Description desc1 = new Description("Description 1.");
288 final Race pobj = new Race();
289 pobj.addToListFor(ListKey.DESCRIPTION, desc1);
290
291 PlayerCharacter pc = getCharacter();
292 assertEquals("Description should match", "Description 1.", pc
293 .getDescription(pobj));
294
295 final Description desc2 = new Description("Description 2.");
296 pobj.addToListFor(ListKey.DESCRIPTION, desc2);
297
298 assertEquals("Description should match", "Description 1. Description 2.",
299 pc.getDescription(pobj));
300
301 final Description desc3 = new Description("Description %1.");
302 desc3.addVariable("\"3\"");
303 pobj.addToListFor(ListKey.DESCRIPTION, desc3);
304
305 assertEquals("Description should match",
306 "Description 1. Description 2. Description 3.", pc
307 .getDescription(pobj));
308
309 pobj.removeFromListFor(ListKey.DESCRIPTION, desc2);
310 assertEquals("Description should match", "Description 1. Description 3.",
311 pc.getDescription(pobj));
312 }
313
314 /**
315 * Test the definition and application of abilities.

Callers

nothing calls this directly

Calls 5

getDescriptionMethod · 0.95
addVariableMethod · 0.95
addToListForMethod · 0.65
removeFromListForMethod · 0.65
getCharacterMethod · 0.45

Tested by

no test coverage detected