Skip to content

Commit

Permalink
renamed addToCurrentXP addExperience, inferring current xp
Browse files Browse the repository at this point in the history
  • Loading branch information
matyb committed Feb 22, 2012
1 parent b514862 commit 6140afe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dnd_tdd/test/org/dnd/CharacterTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package org.dnd;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
Expand Down Expand Up @@ -191,28 +190,28 @@ public void testNewCharacterDefaultsToLevel1() throws Exception {
@Test
public void testEvery1000HitPointsLevelsUpCharacter() throws Exception {
Character me = new Character();
me.addToCurrentXP(2000);
me.addExperience(2000);
assertEquals(3, me.getLevel());
}

@Test
public void testEveryLevelIncreasesBaseHPBy5() throws Exception {
Character me = new Character();
me.addToCurrentXP(2000);
me.addExperience(2000);
assertEquals(15, me.getHP());
}

@Test
public void testForEveryEvenLevelAddOneToRoll_EvenLevel() throws Exception {
Character me = new Character();
me.addToCurrentXP(1000);
me.addExperience(1000);
assertEquals(11, me.getModifiedRoll(10));
}

@Test
public void testForEveryEvenLevelAddOneToRoll_OddLevel() throws Exception {
Character me = new Character();
me.addToCurrentXP(2000);
me.addExperience(2000);
assertEquals(11, me.getModifiedRoll(10));
}
}

0 comments on commit 6140afe

Please sign in to comment.