public void Each_ability_is_only_calculated_once() { for (var i = 0; i < 10; i++) { var sut = DndCharacter.Generate(); Assert.Equal(sut.Strength, sut.Strength); Assert.Equal(sut.Dexterity, sut.Dexterity); Assert.Equal(sut.Constitution, sut.Constitution); Assert.Equal(sut.Intelligence, sut.Intelligence); Assert.Equal(sut.Wisdom, sut.Wisdom); Assert.Equal(sut.Charisma, sut.Charisma); } }
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)); } }