def test_add_zero_valueerror(self): """ Test that adding 0 number of dice raises a ValueError. """ roll = Roll(3) roll.add(0)
def test_add_negative_valueerror(self): """ Test that adding a negative number of dice raises a ValueError. """ roll = Roll(3) roll.add(-3)
def test_add_not_int_valueerror(self): """ Test that adding a non-integer number of dice raises a ValueError. """ roll = Roll(3) roll.add([2, 4, 3])
def test_add_becomes_fumble(self): """ Test that adding dice with glitches causes the roll to become a fumble. """ roll = Roll(3) self.assertFalse(roll.fumble) roll.add(2) self.assertTrue(roll.fumble)
def test_add_becomes_glitch(self): """ Test that adding dice with glitches causes the roll to become a glitch. """ roll = Roll(3) self.assertFalse(roll.glitch) roll.add(2) self.assertTrue(roll.glitch)
def test_add_gliches_added(self): """ Test that adding dice updates the number of glitches. """ roll = Roll(3) self.assertEquals(roll.glitches, 2) roll.add(3) self.assertEquals(roll.glitches, 3)
def test_add_original_dice_pool_not_increased(self): """ Test that adding dice does not affect the original number of dice. """ roll = Roll(4) self.assertEquals(roll.original_dice_pool, 4) roll.add(3) self.assertEquals(roll.original_dice_pool, 4)
def test_add_dice_pool_increased(self): """ Test that adding dice updates the number of dice. """ roll = Roll(4) self.assertEquals(roll.dice_pool, 4) roll.add(3) self.assertEquals(roll.dice_pool, 7)
def test_add_hits_increased(self): """ Test that adding dice updates the number of hits. """ roll = Roll(3) self.assertEquals(roll.hits, 1) roll.add(3) self.assertEquals(roll.hits, 2)
def test_add_dice_updated(self): """ Test that adding dice updates the dice list. """ roll = Roll(3) self.assertEquals(roll.dice, [1, 3, 5]) roll.add(3) self.assertEquals(roll.dice, [1, 3, 5, 2, 4, 1])
def test_add_edge_explodes(self): """ Test that adding sixes explode, as they are added using Edge. """ roll = Roll(3) self.assertEquals(roll.dice_pool, 3) roll.add(3) self.assertEquals(roll.dice_pool, 7) self.assertEquals(roll.dice, [6, 2, 3, 6, 1, 4, 1])