Esempio n. 1
0
 @Test
 public void settersAndGettersWork() {
   spell.setCost(10);
   assertEquals(10, spell.getCost());
   spell.setDescription("whatever");
   assertEquals("whatever", spell.getDescription());
   spell.setDescription(null);
   assertEquals(Spell.NO_DESCRIPTION_VALUE, spell.getDescription());
 }
Esempio n. 2
0
 @Test
 public void isInitializedCorrectly() {
   assertEquals(NAME, spell.getName());
   assertEquals(COST, spell.getCost());
   assertEquals(DESCRIPTION, spell.getDescription());
 }
Esempio n. 3
0
 @Test
 public void costCannotFallBelowZero() {
   spell.setCost(-5);
   assertEquals(0, spell.getCost());
 }