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)); }
private void FullFwAssertValid(ITimedDto timedDto) { FullFwAssertValid((ITimestampedDto)timedDto); if (_sampleAppClientCallTiming != null) { timedDto.ShouldOccurBetween(_sampleAppClientCallTiming); } }
protected static void ShouldBeMonotonicInTime(IEnumerable <ITimedDto> timedDtos) { ITimedDto prev = null; foreach (var timedDto in timedDtos) { prev?.ShouldOccurBefore(timedDto); prev = timedDto; } }
private void FullFwAssertValid(ITimedDto timedDto) { FullFwAssertValid((ITimestampedDto)timedDto); timedDto.Duration.Should().BeGreaterOrEqualTo(0); if (_sampleAppClientCallTiming != null) { timedDto.ShouldOccurBetween(_sampleAppClientCallTiming); } }
protected static bool OccursBetween(ITimedDto containedDto, ITimedDto containingDto) => containingDto.Timestamp <= containedDto.Timestamp && TimeUtils.ToEndDateTime(containedDto.Timestamp, containedDto.Duration) <= TimeUtils.ToEndDateTime(containingDto.Timestamp, containingDto.Duration);
internal static void ShouldOccurBefore(this ITimedDto first, ITimestampedDto second) => TimeUtils.ToEndDateTime(first.Timestamp, first.Duration).Should().BeOnOrBefore(TimeUtils.ToDateTime(second.Timestamp));