[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)); }
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)); }
[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)); }