public void Nullifnullbalance() { var sut = new RightsDailyAfter90Surcharger(); var lse = LeaseWithPenaltyRates(0.2M, 0.03M); var oldBal = (decimal?)null; var charges = sut.GetPenalties(lse, 3.May(2018), oldBal); charges.Should().BeNull(); }
public void TestMethod00004() { var sut = new RightsDailyAfter90Surcharger(); var lse = LeaseWithPenaltyRates(0.2M, 0.03M) .RightsDueOn(7.May(2018)); var oldBal = 120; var charges = sut.GetPenalties(lse, 9.May(2018), oldBal); charges.Should().BeNull(); }
public void ErrorifDifferentRule() { var sut = new RightsDailyAfter90Surcharger(); var lse = LeaseWithPenaltyRates(0.2M, 0.03M); lse.Rights.PenaltyRule = "a different rule"; sut.Invoking(_ => _.GetPenalties(lse, 3.May(2018), 123)) .Should().Throw <BadKeyException>(); }
public void TestMethod00003() { var sut = new RightsDailyAfter90Surcharger(); var lse = LeaseWithPenaltyRates(0.2M, 0.03M) .RightsDueOn(7.May(2018)); var oldBal = 100; var charges = sut.GetPenalties(lse, 8.May(2018), oldBal); charges.Should().HaveCount(1); charges.Single().Amount.Should().Be(oldBal * 0.2M); }
public void TestMethod00005() { var sut = new RightsDailyAfter90Surcharger(); var due = 7.May(2018); var dte = due.AddDays(89); var lse = LeaseWithPenaltyRates(0.2M, 0.03M) .RightsDueOn(due); var oldBal = 120; var charges = sut.GetPenalties(lse, dte, oldBal); charges.Should().BeNull(); }
public void Nullifinactivelease() { var sut = new RightsDailyAfter90Surcharger(); var lse = new InactiveLeaseDTO { Rights = new RightsParams { PenaltyRule = sut.RuleName } }; var charges = sut.GetPenalties(lse, 3.May(2018), 123); charges.Should().BeNull(); }
public void TestMethod00007() { var sut = new RightsDailyAfter90Surcharger(); var due = 7.May(2018); var dte = due.AddDays(91); var lse = LeaseWithPenaltyRates(0.2M, 0.03M) .RightsDueOn(due); var oldBal = 123.60M; var expctd = Math.Round(oldBal * 0.03M, 0); var charges = sut.GetPenalties(lse, dte, oldBal); charges.Should().HaveCount(1); charges.Single().Amount.Should().Be(expctd); }