Beispiel #1
0
        public void Union(string first, string second, string expected)
        {
            DateInterval firstInterval  = ParseInterval(first);
            DateInterval secondInterval = ParseInterval(second);
            DateInterval?expectedResult = ParseIntervalOrNull(expected);

            Assert.Multiple(() =>
            {
                Assert.AreEqual(expectedResult, firstInterval.Union(secondInterval), "First union failed.");
                Assert.AreEqual(expectedResult, secondInterval.Union(firstInterval), "Second union failed.");
            });
        }
Beispiel #2
0
 public void Clear()
 {
     list.Clear();
     work     = CheckedState.Indeterminate;
     template = null;
     stage    = null;
     staff    = null;
     id       = null;
     number   = null;
     date     = null;
     dtype    = DocumentSearchDate.Create;
     title    = null;
     //IsCurrent = true;
     OnPropertyChanged(string.Empty);
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DateRangeBound"/> class.
 /// </summary>
 /// <param name="relativeAmount">The relative amount.</param>
 /// <param name="relativeInterval">The relative interval.</param>
 /// <param name="specificDate">The specific date.</param>
 /// <param name="windowAmount">The window amount.</param>
 /// <param name="windowInterval">The window interval.</param>
 public DateRangeBound(int?relativeAmount, DateInterval?relativeInterval, DateTime?specificDate, int?windowAmount, DateInterval?windowInterval)
 {
     if (specificDate.HasValue)
     {
         this.SpecificDate = specificDate;
     }
     else if (windowAmount.HasValue && windowInterval.HasValue)
     {
         this.WindowAmount   = windowAmount;
         this.WindowInterval = windowInterval;
     }
     else
     {
         this.RelativeAmount   = relativeAmount;
         this.RelativeInterval = relativeInterval;
     }
 }
Beispiel #4
0
        public void Union()
        {
            DateInterval firstInterval = new DateInterval(
                new LocalDate(2014, 3, 7),
                new LocalDate(2014, 3, 20));

            DateInterval secondInterval = new DateInterval(
                new LocalDate(2014, 3, 15),
                new LocalDate(2014, 3, 23));

            DateInterval?overlappingInterval = Snippet.For(firstInterval.Union(secondInterval));

            Assert.AreEqual(
                new DateInterval(
                    new LocalDate(2014, 3, 7),
                    new LocalDate(2014, 3, 23)),
                overlappingInterval);
        }
 public WaitingPeriodState(int stateId, TimerType timerType, int?delayPeriod, DateInterval?dateInterval,
                           RunOn?runOn, TimeSpan?runAt, RunType?runType, DateTime?runOnDate, DateTime?startDate, DateTime?endDate,
                           IEnumerable <DayOfWeek> runOnDays, int workflowId, IWorkflowService workflowService, IPublishSubscribeService pubSubService)
     : base(stateId)
 {
     this.timerType       = timerType;
     this.delayPeriod     = delayPeriod;
     this.dateInterval    = dateInterval;
     this.runOn           = runOn;
     this.runAt           = runAt;
     this.runType         = runType;
     this.runOnDate       = runOnDate;
     this.startDate       = startDate;
     this.endDate         = endDate;
     this.runOnDays       = runOnDays;
     this.workflowId      = workflowId;
     this.pubSubService   = pubSubService;
     this.workflowService = workflowService;
 }
Beispiel #6
0
 /// <inheritdoc cref="IDateHistogramCompositeAggregationSource.CalendarInterval" />
 public DateHistogramCompositeAggregationSourceDescriptor <T> CalendarInterval(DateInterval?interval) =>
 Assign(interval, (a, v) => a.CalendarInterval = v);
Beispiel #7
0
 /// <inheritdoc cref ="IRateAggregation.Unit"/>
 public RateAggregationDescriptor <T> Unit(DateInterval?dateInterval) =>
 Assign(dateInterval, (a, v) => a.Unit = v);
Beispiel #8
0
 /// <inheritdoc cref="IDateHistogramCompositeAggregationSource.Interval"/>
 public DateHistogramCompositeAggregationSourceDescriptor <T> Interval(DateInterval?interval) =>
 Assign(a => a.Interval = interval);