예제 #1
0
        public void StandingChargeDescription()
        {
            var p = Invoice.StandingCharges();
            var t = new TermsItem(Contract.InvoiceTerm.Start, 12 / (uint)Contract.InvoiceFrequency);

            Assert.IsTrue(p[0].Description.Contains(t.TermSpan(0).Start.ToShortDateString()));
            Assert.IsTrue(p[0].Description.Contains(t.TermSpan(0).End.ToShortDateString()));
            Assert.IsTrue(p[1].Description.Contains(t.TermSpan(1).Start.ToShortDateString()));
            Assert.IsTrue(p[1].Description.Contains(t.TermSpan(1).End.ToShortDateString()));
        }
예제 #2
0
        public void MonthTermSpan()
        {
            var i = new TermsItem(new DateTime(2019, 1, 1), 12, PeriodUnit.Month);
            var s = i.TermSpan(2);

            Assert.AreEqual(s.Start, new DateTime(2019, 3, 1));
            Assert.AreEqual(s.End, new DateTime(2019, 3, 31));
        }
예제 #3
0
        public void QuarterTermSpan()
        {
            var i = new TermsItem(new DateTime(2019, 1, 1), 4, PeriodUnit.Quarter);
            var s = i.TermSpan(1);

            Assert.AreEqual(s.Start, new DateTime(2019, 4, 1));
            Assert.AreEqual(s.End, new DateTime(2019, 6, 30));
        }
예제 #4
0
        public void TermSpanOfLast()
        {
            var i = new TermsItem(new DateTime(2018, 1, 15), 4, PeriodUnit.Quarter);
            var t = new TermSpan()
            {
                Number = 3, Start = new DateTime(2018, 10, 15), End = new DateTime(2019, 1, 14)
            };

            Assert.AreEqual(i.TermSpan(new DateTime(2019, 1, 14)), t);
        }
예제 #5
0
        public PriceList StandingCharges()
        {
            var list = new PriceList();

            for (var i = 0; i < MonthsInInvoiceTerm; i++)
            {
                var term   = InvoiceTerm.TermSpan((uint)i);
                var charge = Contract.MonthlyCharge.Clone().AppendToDescription(
                    $" Period {term.Start.ToShortDateString()} to {term.End.ToShortDateString()}.");
                list.Add(charge);
            }

            return(list);
        }
예제 #6
0
        public void TermNumberAfterPeriod()
        {
            var i = new TermsItem(new DateTime(2018, 2, 1), 12, PeriodUnit.Month);

            i.TermSpan(new DateTime(2020, 1, 1));
        }
예제 #7
0
        public void TermSpanOfDateAfter()
        {
            var i = new TermsItem(new DateTime(2018, 2, 1), 12, PeriodUnit.Month);

            i.TermSpan(new DateTime(2019, 2, 1));
        }
예제 #8
0
        public void TermSpanOfDateBefore()
        {
            var i = new TermsItem(new DateTime(2018, 2, 1), 12, PeriodUnit.Month);

            i.TermSpan(new DateTime(2018, 1, 31));
        }
예제 #9
0
        public void TermSpanOf12()
        {
            var i = new TermsItem(new DateTime(2018, 2, 1), 12, PeriodUnit.Month);

            i.TermSpan(12);
        }