Exemplo n.º 1
0
 internal static void ShouldOccurBetween(this ITimestampedDto child, ITimedDto containingAncestor)
 {
     TimeUtils.TimestampToDateTimeOffset(child.Timestamp)
     .Should()
     .BeOnOrAfter(TimeUtils.TimestampToDateTimeOffset(containingAncestor.Timestamp))
     .And
     .BeOnOrBefore(TimeUtils.TimestampDurationToEndDateTimeOffset(containingAncestor.Timestamp, containingAncestor.Duration));
 }
        internal static void ShouldOccurBetween(this ITimedDto child, ITimedDto containingAncestor)
        {
            ((ITimestampedDto)child).ShouldOccurBetween(containingAncestor);

            TimeUtils.ToEndDateTime(child.Timestamp, child.Duration)
            .Should()
            .BeOnOrBefore(TimeUtils.ToEndDateTime(containingAncestor.Timestamp, containingAncestor.Duration));
        }
Exemplo n.º 3
0
        private void FullFwAssertValid(ITimedDto timedDto)
        {
            FullFwAssertValid((ITimestampedDto)timedDto);

            if (_sampleAppClientCallTiming != null)
            {
                timedDto.ShouldOccurBetween(_sampleAppClientCallTiming);
            }
        }
Exemplo n.º 4
0
        protected static void ShouldBeMonotonicInTime(IEnumerable <ITimedDto> timedDtos)
        {
            ITimedDto prev = null;

            foreach (var timedDto in timedDtos)
            {
                prev?.ShouldOccurBefore(timedDto);
                prev = timedDto;
            }
        }
Exemplo n.º 5
0
        private void FullFwAssertValid(ITimedDto timedDto)
        {
            FullFwAssertValid((ITimestampedDto)timedDto);

            timedDto.Duration.Should().BeGreaterOrEqualTo(0);

            if (_sampleAppClientCallTiming != null)
            {
                timedDto.ShouldOccurBetween(_sampleAppClientCallTiming);
            }
        }
Exemplo n.º 6
0
 protected static bool OccursBetween(ITimedDto containedDto, ITimedDto containingDto) =>
 containingDto.Timestamp <= containedDto.Timestamp
 &&
 TimeUtils.ToEndDateTime(containedDto.Timestamp, containedDto.Duration)
 <=
 TimeUtils.ToEndDateTime(containingDto.Timestamp, containingDto.Duration);
Exemplo n.º 7
0
 internal static void ShouldOccurBefore(this ITimedDto first, ITimestampedDto second) =>
 TimeUtils.ToEndDateTime(first.Timestamp, first.Duration).Should().BeOnOrBefore(TimeUtils.ToDateTime(second.Timestamp));