/// <summary> /// Initializes a new instance of the <see cref="BoundedFiscalReportingPeriod"/> class. /// </summary> /// <param name="start">The start of the reporting period.</param> /// <param name="end">The end of the reporting period.</param> public BoundedFiscalReportingPeriod( FiscalUnitOfTime start, FiscalUnitOfTime end) : base(start, end) { new { start }.AsArg().Must().NotBeOfType <FiscalUnbounded>(); new { end }.AsArg().Must().NotBeOfType <FiscalUnbounded>(); }
/// <summary> /// Initializes a new instance of the <see cref="SemiBoundedFiscalReportingPeriod"/> class. /// </summary> /// <param name="start">The start of the reporting period.</param> /// <param name="end">The end of the reporting period.</param> public SemiBoundedFiscalReportingPeriod( FiscalUnitOfTime start, FiscalUnitOfTime end) : base(start, end) { var startIsUnbounded = start is FiscalUnbounded; var endIsUnbounded = end is FiscalUnbounded; if (startIsUnbounded || endIsUnbounded) { if (startIsUnbounded && endIsUnbounded) { throw new ArgumentException("one and only one of start and end must be unbounded"); } } else { throw new ArgumentException("one and only one of start and end must be unbounded"); } }
/// <summary> /// Initializes a new instance of the <see cref="FiscalReportingPeriod"/> class. /// </summary> /// <param name="start">The start of the reporting period.</param> /// <param name="end">The end of the reporting period.</param> public FiscalReportingPeriod( FiscalUnitOfTime start, FiscalUnitOfTime end) : base(start, end) { }