-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change max_hd and current_hd in level.setter
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from dnd_character.classes import Barbarian, Rogue, Sorcerer | ||
|
||
|
||
def test_hd_for_barb_rogue_sorc(): | ||
barb = Barbarian() | ||
rogue = Rogue() | ||
sorc = Sorcerer() | ||
assert barb.hd == 12 | ||
assert rogue.hd == 8 | ||
assert sorc.hd == 6 | ||
|
||
|
||
def test_max_hd_at_level_1(): | ||
barb = Barbarian(level=1) | ||
assert barb.max_hd == 1 | ||
|
||
|
||
def test_max_hd_at_level_10(): | ||
barb = Barbarian(level=10) | ||
assert barb.max_hd == 10 | ||
|
||
|
||
def test_current_hd_increases_at_level_up(): | ||
barb = Barbarian(level=1) | ||
assert barb.current_hd == 1 | ||
barb.level = 2 | ||
assert barb.current_hd == 2 |