public void GivenCharacterHasOneHitPointLeftWhenRollIsGreaterThanArmorThenCharacterIsDead() { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.Attack(11, game.Chars[1]); game.Attack(11, game.Chars[1]); game.Attack(11, game.Chars[1]); game.Attack(11, game.Chars[1]); game.Attack(11, game.Chars[1]); game.Chars[1].HitPts.Should().Be(0); game.IsDead(game.Chars[1]).Should().Be(true); }
public void GivenGameHasStartedWhenRollIsACriticalHitThenCharacterTakesDoubleDamage() { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.Attack(20, game.Chars[1]); game.Chars[1].HitPts.Should().Be(3); }
public void GivenGameHasStartedWhenRollIsLessThanArmorThenNoDamageIsDealt() { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.Attack(9, game.Chars[1]); game.Chars[1].HitPts.Should().Be(5); }
public void GivenGameHasStartedWhenRollIsEqualToArmorThenCharacterTakesDamage() { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.Attack(10, game.Chars[1]); game.Chars[1].HitPts.Should().Be(4); }
public void GivenGameHasStartedWhenSecondCharacterAttacksTheFirstThenFirstCharacterTakesDamage() { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.Attack(10, game.Chars[0]); game.Chars[0].HitPts.Should().Be(4); }
public void GivenFirstCharacterHasDexterityWithPositiveModifierWhenRollIsLessThanModifiedArmorThenFirstCharacterTakesNoDamage(int dexterity, int modifier) { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.ApplyDexterity(dexterity, game.Chars[0]); game.Attack(9 + modifier, game.Chars[0]); game.Chars[0].HitPts.Should().Be(5); }
public void GivenSecondCharacterHasStrengthWithPositiveModifierWhenRollIsModifiedToBeLessThanArmorThenSecondCharacterTakesOneDamage(int strength, int modifier) { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.ApplyStrength(strength, game.Chars[1]); game.Attack(9 - modifier, game.Chars[0]); game.Chars[0].HitPts.Should().Be(4); }
public void GivenSecondCharacterHasConstitutionWithNegative_5_ModifierWhenRollIsGreaterThanArmorThenSecondCharacterDies() { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.ApplyConstitution(1, game.Chars[1]); game.Attack(10, game.Chars[1]); game.IsDead(game.Chars[1]).Should().Be(true); }
public void GivenSecondCharacterHasDexterityWithPositiveModifierWhenRollIsGreaterThanModifiedArmorThenSecondCharacterTakesDamage(int dexterity, int modifier) { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.ApplyDexterity(dexterity, game.Chars[1]); game.Attack(10 + modifier, game.Chars[1]); game.Chars[1].HitPts.Should().Be(4); }
public void GivenCharacterHasStrengthWithNegativeModifierWhenRollIsModifiedToBeGreaterThanArmorThenCharacterTakesTwoDamage(int strength, int modifier) { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.ApplyStrength(strength, game.Chars[0]); game.Attack(10 - modifier, game.Chars[1]); game.Chars[1].HitPts.Should().Be(3); }
public void GivenFirstCharacterHasConstitutionWithPositiveModifierWhenRollIsGreaterThanArmorThenFirstCharacterIsAliveAfterAttacks(int constitution, int attacks) { var game = new EvercraftGame(); game.Start("Jack", "Bob"); game.ApplyConstitution(constitution, game.Chars[0]); for (var i = 0; i < attacks; i++) { game.Attack(10, game.Chars[0]); } game.IsDead(game.Chars[0]).Should().Be(false); }