Example #1
0
        [TestCase(1, "1/3 -3", -3)] // could be negative.  If that's a worry, "0..".
        public void Can_offset_ratio(int input, string description, int expectedBlocked)
        {
            var cr      = new ClampedRatio(description);
            int blocked = cr.Apply(input);

            Assert.That(blocked, Is.EqualTo(expectedBlocked));
        }
Example #2
0
        public void Offset_is_applied_before_clamp(int input, string description, int expectedBlocked)
        {
            var cr      = new ClampedRatio(description);
            int blocked = cr.Apply(input);

            Assert.That(blocked, Is.EqualTo(expectedBlocked));
        }
Example #3
0
        [TestCase(4, "2/3 8..", 4)] // even a good shield cannot block more damage than came in
        public void Can_let_input_move_clamp(int input, string description, int expectedBlocked)
        {
            var cr = new ClampedRatio(description);

            cr.InputMovesClamp = true;
            int blocked = cr.Apply(input);

            Assert.That(blocked, Is.EqualTo(expectedBlocked));
        }