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())); }
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)); }
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)); }
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); }
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); }
public void TermNumberAfterPeriod() { var i = new TermsItem(new DateTime(2018, 2, 1), 12, PeriodUnit.Month); i.TermSpan(new DateTime(2020, 1, 1)); }
public void TermSpanOfDateAfter() { var i = new TermsItem(new DateTime(2018, 2, 1), 12, PeriodUnit.Month); i.TermSpan(new DateTime(2019, 2, 1)); }
public void TermSpanOfDateBefore() { var i = new TermsItem(new DateTime(2018, 2, 1), 12, PeriodUnit.Month); i.TermSpan(new DateTime(2018, 1, 31)); }
public void TermSpanOf12() { var i = new TermsItem(new DateTime(2018, 2, 1), 12, PeriodUnit.Month); i.TermSpan(12); }