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

Method getEquipmentLocations

code/src/test/pcgen/core/DataSetTest.java:82–105  ·  view source on GitHub ↗

Test method for pcgen.core.DataSet#getEquipmentLocations(). Validate that known body structures get added.

()

Source from the content-addressed store, hash-verified

80 * that known body structures get added.
81 */
82 public static void getEquipmentLocations()
83 {
84 final String structName = "TestStruct";
85 SystemCollections.addToBodyStructureList(structName, SettingsHandler.getGameAsProperty().get().getName());
86 DataSet dataset =
87 new DataSet(Globals.getContext(), SettingsHandler.getGameAsProperty().get(),
88 new DefaultListFacade<>());
89 ListFacade<BodyStructure> locations =
90 dataset.getEquipmentLocations();
91 assertNotNull(locations, "Body Structure should not be null");
92 // TODO i18n this. It should be the same value as structname, not the localized value.
93 assertTrue(
94 checkBodyStructurePresent(locations, "Teststruct"),
95 "Expected to find added body structure '" + structName + "'"
96 );
97 assertTrue(checkBodyStructurePresent(
98 locations, Constants.EQUIP_LOCATION_EQUIPPED), "Expected to find Equipped");
99 assertTrue(checkBodyStructurePresent(
100 locations, Constants.EQUIP_LOCATION_CARRIED), "Expected to find Carried");
101 assertTrue(checkBodyStructurePresent(
102 locations, Constants.EQUIP_LOCATION_NOTCARRIED), "Expected to find Not Carried");
103 assertEquals(4, locations
104 .getSize(), "Incorrect size of body structures list");
105 }
106
107 /**
108 * Verify the getPrereqAbilities method is functioning correctly.

Callers 1

Calls 8

getGameAsPropertyMethod · 0.95
getContextMethod · 0.95
getEquipmentLocationsMethod · 0.95
getNameMethod · 0.65
getMethod · 0.65
getSizeMethod · 0.65

Tested by

no test coverage detected