private static void AssertZeroExecutionSummary(ExecutionTimeSummary summary) { Assert.That(summary.Start, Is.EqualTo(summary.End), () => "start and end should be the same"); Assert.That(summary.Start, Is.EqualTo(DateTimeOffset.UtcNow).Within(TimeSpan.FromSeconds(1)), () => "start should be DateTimeOffset.UtcNow"); AssertDurations(summary, TimeSpan.Zero, TimeSpan.Zero, TimeSpan.Zero); }
private static void AssertDurations(ExecutionTimeSummary summary, TimeSpan expectedDuration, TimeSpan expectedAggregated, TimeSpan expectedAverage) { Assert.That(summary.Duration, Is.EqualTo(expectedDuration), () => nameof(summary.Duration)); Assert.That(summary.Aggregated, Is.EqualTo(expectedAggregated), () => nameof(summary.Aggregated)); Assert.That(summary.Average, Is.EqualTo(expectedAverage), () => nameof(summary.Average)); }
private void AssertExecutionSummary(ExecutionTimeSummary summary, DateTimeOffset expectedStart, DateTimeOffset expectedEnd, TimeSpan expectedDuration, TimeSpan expectedAggregated, TimeSpan expectedAverage) { Assert.That(summary.Start, Is.EqualTo(expectedStart), () => nameof(summary.Start)); Assert.That(summary.End, Is.EqualTo(expectedEnd), () => nameof(summary.End)); AssertDurations(summary, expectedDuration, expectedAggregated, expectedAverage); }