Example #1
0
 public void Random_character_is_valid()
 {
     for (var i = 0; i < 10; i++)
     {
         var sut = DndCharacter.Generate();
         Assert.InRange(sut.Strength, 3, 18);
         Assert.InRange(sut.Dexterity, 3, 18);
         Assert.InRange(sut.Constitution, 3, 18);
         Assert.InRange(sut.Intelligence, 3, 18);
         Assert.InRange(sut.Wisdom, 3, 18);
         Assert.InRange(sut.Charisma, 3, 18);
         Assert.Equal(sut.Hitpoints, 10 + DndCharacter.Modifier(sut.Constitution));
     }
 }
Example #2
0
 public void Ability_modifier_for_score_18_is_4()
 {
     Assert.Equal(4, DndCharacter.Modifier(18));
 }
Example #3
0
 public void Ability_modifier_for_score_17_is_3()
 {
     Assert.Equal(3, DndCharacter.Modifier(17));
 }
Example #4
0
 public void Ability_modifier_for_score_3_is_minus_4()
 {
     Assert.Equal(-4, DndCharacter.Modifier(3));
 }
Example #5
0
 public void Ability_modifier_for_score_15_is_2()
 {
     Assert.Equal(2, DndCharacter.Modifier(15));
 }
Example #6
0
 public void Ability_modifier_for_score_13_is_1()
 {
     Assert.Equal(1, DndCharacter.Modifier(13));
 }
Example #7
0
 public void Ability_modifier_for_score_11_is_0()
 {
     Assert.Equal(0, DndCharacter.Modifier(11));
 }
Example #8
0
 public void Ability_modifier_for_score_9_is_minus_1()
 {
     Assert.Equal(-1, DndCharacter.Modifier(9));
 }
Example #9
0
 public void Ability_modifier_for_score_7_is_minus_2()
 {
     Assert.Equal(-2, DndCharacter.Modifier(7));
 }
Example #10
0
 public void Ability_modifier_for_score_5_is_minus_3()
 {
     Assert.Equal(-3, DndCharacter.Modifier(5));
 }