public async Task CanRecordStatInAsyncAction() { var publisher = new FakeStatsPublisher(); await publisher.Time("statOverAsyncAction", async() => await DelayAsync()); PublisherAssertions.SingleStatNameIs(publisher, "statOverAsyncAction"); }
public async Task CorrectDurationForStatInAsyncFunction() { var publisher = new FakeStatsPublisher(); await publisher.Time("stat", async() => await DelayedAnswerAsync()); PublisherAssertions.LastDurationIs(publisher, StandardDelayMillis); }
public async Task CanRecordStatInAsyncFunction() { var publisher = new FakeStatsPublisher(); var answer = await publisher.Time("statOverAsyncFunc", async() => await DelayedAnswerAsync()); Assert.That(answer, Is.EqualTo(42)); PublisherAssertions.SingleStatNameIs(publisher, "statOverAsyncFunc"); }
public void CanRecordStatInAction() { var publisher = new FakeStatsPublisher(); publisher.Time("statOverAction", () => Delay()); PublisherAssertions.SingleStatNameIs(publisher, "statOverAction"); PublisherAssertions.LastDurationIs(publisher, StandardDelayMillis); }
public void CanRecordStatInFunction() { var publisher = new FakeStatsPublisher(); var answer = publisher.Time("statOverFunc", () => DelayedAnswer()); Assert.That(answer, Is.EqualTo(42)); PublisherAssertions.SingleStatNameIs(publisher, "statOverFunc"); PublisherAssertions.LastDurationIs(publisher, StandardDelayMillis); }
public async Task CorrectDurationForStatInAsyncFunction() { var publisher = new FakeStatsPublisher(); await publisher.Time("stat", async () => await DelayedAnswerAsync()); PublisherAssertions.LastDurationIs(publisher, StandardDelayMillis); }
public async Task CanRecordStatInAsyncFunction() { var publisher = new FakeStatsPublisher(); var answer = await publisher.Time("statOverAsyncFunc", async () => await DelayedAnswerAsync()); Assert.That(answer, Is.EqualTo(42)); PublisherAssertions.SingleStatNameIs(publisher, "statOverAsyncFunc"); }
public async Task CanRecordStatInAsyncAction() { var publisher = new FakeStatsPublisher(); await publisher.Time("statOverAsyncAction", async () => await DelayAsync()); PublisherAssertions.SingleStatNameIs(publisher, "statOverAsyncAction"); }