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

Method setUp

code/src/test/plugin/exporttokens/ACTokenTest.java:58–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56 private Equipment chainShirt;
57
58 @BeforeEach
59 @Override
60 protected void setUp() throws Exception
61 {
62 super.setUp();
63 LoadContext context = Globals.getContext();
64 PlayerCharacter character = getCharacter();
65 setPCStat(character, dex, 14);
66 dex.removeListFor(ListKey.BONUS);
67 BonusObj aBonus = Bonus.newBonus(context, "COMBAT|AC|10|TYPE=Base");
68
69 if (aBonus != null)
70 {
71 dex.addToListFor(ListKey.BONUS, aBonus);
72 }
73 // Ignoring max dex
74 aBonus = Bonus.newBonus(context, "COMBAT|AC|DEX|TYPE=Ability");
75
76 if (aBonus != null)
77 {
78 dex.addToListFor(ListKey.BONUS, aBonus);
79 }
80
81 EquipSet def = new EquipSet("0.1", "Default");
82 character.addEquipSet(def);
83 character.setCalcEquipmentList();
84
85 character.calcActiveBonuses();
86
87 // Create non magic armor
88 chainShirt = new Equipment();
89 chainShirt.setName("Chain Shirt");
90 chainShirt.put(StringKey.KEY_NAME, "KEY_Chain_Shirt");
91 TestHelper.addType(chainShirt, "Armor.Light.Suit.Standard");
92 chainShirt.put(IntegerKey.AC_CHECK, -2);
93 aBonus = Bonus.newBonus(context, "COMBAT|AC|4|TYPE=Armor.REPLACE");
94
95 if (aBonus != null)
96 {
97 chainShirt.addToListFor(ListKey.BONUS, aBonus);
98 }
99
100 // Create magic armor enhancement
101 masterwork = new EquipmentModifier();
102 masterwork.setName("Masterwork");
103 masterwork.put(StringKey.KEY_NAME, "MWORKA");
104 TestHelper.addType(masterwork, "Armor.Shield");
105 masterwork.addToListFor(ListKey.ITEM_TYPES, Type.MASTERWORK);
106 aBonus = Bonus.newBonus(context, "EQMARMOR|ACCHECK|1|TYPE=Enhancement");
107
108 if (aBonus != null)
109 {
110 masterwork.addToListFor(ListKey.BONUS, aBonus);
111 }
112 context.getReferenceContext().importObject(masterwork);
113
114 plus1 = new EquipmentModifier();
115 plus1.setName("Plus 1 Enhancement");

Callers

nothing calls this directly

Calls 15

getContextMethod · 0.95
newBonusMethod · 0.95
addEquipSetMethod · 0.95
setCalcEquipmentListMethod · 0.95
calcActiveBonusesMethod · 0.95
addTypeMethod · 0.95
getReferenceContextMethod · 0.95
getConstantMethod · 0.95
getGameAsPropertyMethod · 0.95
isValidACTypeMethod · 0.95
addACAddsMethod · 0.95
importObjectMethod · 0.80

Tested by

no test coverage detected