예제 #1
0
        public void when_roll_5_and_save_6_miss()
        {
            SaveRoll roll = new SaveRoll(6, 5);

            Assert.IsTrue(roll.Missed);
            Assert.IsFalse(roll.Saved);
        }
예제 #2
0
        public void save_roll_of_1_always_miss()
        {
            SaveRoll roll = new SaveRoll(1, 1);

            Assert.IsTrue(roll.Missed);
            Assert.IsFalse(roll.Saved);
        }
예제 #3
0
        public void save_can_be_invulnerable()
        {
            Save     save   = new(4, true);
            SaveRoll result = save.Roll(new OnlyRollFour());

            Assert.IsTrue(result.Saved);
        }
예제 #4
0
        public void save_can_generate_save_roll()
        {
            Save     save   = new(5);
            SaveRoll result = save.Roll(new Dice());

            Assert.IsNotNull(result);
        }
예제 #5
0
        public void invulnerable_save_are_not_afected_by_armor_penetration()
        {
            var      expectedSaveRoll = 4;
            Save     save             = new(expectedSaveRoll, true);
            SaveRoll result           = save.Roll(new OnlyRollFour(), 4);

            Assert.AreEqual(expectedSaveRoll, result.Expected);
        }
예제 #6
0
        public void ranged_attack_can_be_rolled_for_save()
        {
            int     expectedSaveRoll = 5;
            Save    save             = new(expectedSaveRoll);
            Target  target           = new(1, save);
            Shooter shooter          = new(1);
            int     weaponStrenght   = 1;

            RangedAttack rangedAttack = new(target, shooter, weaponStrenght);

            SaveRoll saveRoll = rangedAttack.RollSave(new Dice());

            Assert.AreEqual(expectedSaveRoll, saveRoll.Expected);
        }