public void ZeroDueifatGracePeriod()
        {
            var sut = new RentBillComposer1(null);
            var bil = SampleBillState();
            var lse = SampleLease(out DateTime date);

            lse.Rent.GracePeriodDays = 3;

            sut.GetTotalDue(lse, bil, 1.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 2.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 3.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 4.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 5.May(2018)).Should().Be(120);
        }
        public void Rentnotdueafterbillingday()
        {
            var sut = new RentBillComposer1(null);
            var lse = NewLease(5, 2.May(2018), 1000);
            var bil = SampleBillState(0);
            var due = sut.GetTotalDue(lse, bil, 6.May(2018));

            due.Should().Be(0);
        }
        public void Dueincludesrentrate()
        {
            var sut = new RentBillComposer1(null);
            var lse = SampleLease(out DateTime date);
            var bil = SampleBillState();
            var val = sut.GetTotalDue(lse, bil, date);

            val.Should().Be(lse.Rent.RegularRate);
        }
        public void Dueincludesopeningbalafterbillingday()
        {
            var sut = new RentBillComposer1(null);
            var lse = NewLease(5, 2.May(2018), 1000);
            var bil = SampleBillState(2000);
            var due = sut.GetTotalDue(lse, bil, 6.June(2018));

            due.Should().Be(2000);
        }
        public void ZeroDueifatGracePeriod()
        {
            var sut = new RentBillComposer1(null);
            var lse = NewLease(5, 2.May(2018), 1000);
            var bil = SampleBillState(0);

            lse.Rent.GracePeriodDays = 5;

            sut.GetTotalDue(lse, bil, 1.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 2.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 3.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 4.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 5.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 6.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 7.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 8.May(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 4.June(2018)).Should().Be(0);
            sut.GetTotalDue(lse, bil, 5.June(2018)).Should().Be(1000);
        }
        public void ZeroDueifinactive()
        {
            var sut = new RentBillComposer1(null);
            var lse = SampleLease(out DateTime date);

            lse.ContractEnd = 2.May(2018);
            var bil = SampleBillState();
            var val = sut.GetTotalDue(lse, bil, 3.May(2018));

            val.Should().Be(0);
        }
        public void Dueincludesadjustments()
        {
            var sut = new RentBillComposer1(null);
            var lse = SampleLease(out DateTime date);
            var bil = SampleBillState();

            bil.Adjustments[0].AmountOffset = 789;
            var val = sut.GetTotalDue(lse, bil, date);

            val.Should().Be(bil.TotalAdjustments + lse.Rent.RegularRate);
        }
        public void Dueincludespenalty()
        {
            var sut = new RentBillComposer1(null);
            var lse = SampleLease(out DateTime date);
            var bil = SampleBillState();

            bil.Penalties[0].Amount = 456;
            var val = sut.GetTotalDue(lse, bil, date);

            val.Should().Be(bil.TotalPenalties + lse.Rent.RegularRate);
        }
        public void Dueincludesopeningbal()
        {
            var sut = new RentBillComposer1(null);
            var lse = SampleLease(out DateTime date);
            var bil = SampleBillState();

            bil.OpeningBalance = 123;
            var val = sut.GetTotalDue(lse, bil, date);

            val.Should().Be(bil.OpeningBalance + lse.Rent.RegularRate);
        }
        public void Penaltiesduebeforebillingday()
        {
            var sut = new RentBillComposer1(null);
            var lse = NewLease(5, 2.May(2018), 1000);
            var bil = SampleBillState(0);

            bil.Penalties[0].Amount = 456;
            var due = sut.GetTotalDue(lse, bil, 4.May(2018));

            due.Should().Be(456);
        }
        public void ZeroDueifinactive()
        {
            var sut = new RentBillComposer1(null);
            var lse = NewLease(5, 2.May(2018), 1000);

            lse.ContractEnd = 4.May(2018);
            var bil = SampleBillState(0);
            var due = sut.GetTotalDue(lse, bil, 5.May(2018));

            due.Should().Be(0);
        }
        public void Adjustmentsdueafterbillingday()
        {
            var sut = new RentBillComposer1(null);
            var lse = NewLease(5, 2.May(2018), 1000);
            var bil = SampleBillState(0);

            bil.Adjustments[0].AmountOffset = 456;
            var due = sut.GetTotalDue(lse, bil, 6.May(2018));

            due.Should().Be(456);
        }
Beispiel #13
0
        public void Dueincludesrentrate()
        {
            var sut = new RentBillComposer1(null);
            var lse = SampleLease(out DateTime date);
            var bil = SampleBillState();
            var due = sut.GetTotalDue(lse, bil, date);

            due.Should().Be(lse.Rent.RegularRate);
            var end = sut.ComputeClosingBalance(lse, bil, date);

            end.Should().Be(0);
        }
Beispiel #14
0
        public void Dueincludespenalty()
        {
            var sut = new RentBillComposer1(null);
            var lse = SampleLease(out DateTime date);
            var bil = SampleBillState();

            bil.Penalties[0].Amount = 456;
            var due = sut.GetTotalDue(lse, bil, date);

            due.Should().Be(bil.TotalPenalties + lse.Rent.RegularRate);
            var end = sut.ComputeClosingBalance(lse, bil, date);

            end.Should().Be(0);
        }