Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BoundedCalendarReportingPeriod"/> class.
 /// </summary>
 /// <param name="start">The start of the reporting period.</param>
 /// <param name="end">The end of the reporting period.</param>
 public BoundedCalendarReportingPeriod(
     CalendarUnitOfTime start,
     CalendarUnitOfTime end)
     : base(start, end)
 {
     new { start }.AsArg().Must().NotBeOfType <CalendarUnbounded>();
     new { end }.AsArg().Must().NotBeOfType <CalendarUnbounded>();
 }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SemiBoundedCalendarReportingPeriod"/> class.
        /// </summary>
        /// <param name="start">The start of the reporting period.</param>
        /// <param name="end">The end of the reporting period.</param>
        public SemiBoundedCalendarReportingPeriod(
            CalendarUnitOfTime start,
            CalendarUnitOfTime end)
            : base(start, end)
        {
            var startIsUnbounded = start is CalendarUnbounded;
            var endIsUnbounded   = end is CalendarUnbounded;

            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");
            }
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CalendarReportingPeriod"/> class.
 /// </summary>
 /// <param name="start">The start of the reporting period.</param>
 /// <param name="end">The end of the reporting period.</param>
 public CalendarReportingPeriod(
     CalendarUnitOfTime start,
     CalendarUnitOfTime end)
     : base(start, end)
 {
 }