Exemplo n.º 1
0
        public void GetNewBalance_GivenCalculatedPenaltyGreaterThanOrEqualToMaximumPenaltyValue_AssessesMaximumPenalty()
        {
            GivenCalculatedPenaltyAtOrAboveCap();
            var penalty = new ProportionalPenaltyWithCap(_penaltyPercentage, _maximumPenalty);

            var finalBalance = penalty.GetNewBalance(_initialBalance);

            Assert.That(finalBalance, Is.EqualTo(_initialBalance - _maximumPenalty));
        }
Exemplo n.º 2
0
        public void GetNewBalance_GivenCalculatedPenaltyBelowMaximumPenaltyValue_AssessesCalculatedPenalty()
        {
            GivenCalculatedPenaltyBelowCap();
            var penalty         = new ProportionalPenaltyWithCap(_penaltyPercentage, _maximumPenalty);
            var expectedPenalty = _initialBalance * _penaltyPercentage / 100;

            var finalBalance = penalty.GetNewBalance(_initialBalance);

            Assert.That(finalBalance, Is.EqualTo(_initialBalance - expectedPenalty));
        }