コード例 #1
0
        public async Task CanRecordStatInAsyncAction()
        {
            var publisher = new FakeStatsPublisher();
            await publisher.Time("statOverAsyncAction", async() => await DelayAsync());

            PublisherAssertions.SingleStatNameIs(publisher, "statOverAsyncAction");
        }
コード例 #2
0
        public async Task CorrectDurationForStatInAsyncFunction()
        {
            var publisher = new FakeStatsPublisher();
            await publisher.Time("stat", async() => await DelayedAnswerAsync());

            PublisherAssertions.LastDurationIs(publisher, StandardDelayMillis);
        }
コード例 #3
0
        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");
        }
コード例 #4
0
        public void CanRecordStatInAction()
        {
            var publisher = new FakeStatsPublisher();

            publisher.Time("statOverAction", () => Delay());

            PublisherAssertions.SingleStatNameIs(publisher, "statOverAction");
            PublisherAssertions.LastDurationIs(publisher, StandardDelayMillis);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        public void CanRecordStatInAction()
        {
            var publisher = new FakeStatsPublisher();
            publisher.Time("statOverAction", () => Delay());

            PublisherAssertions.SingleStatNameIs(publisher, "statOverAction");
            PublisherAssertions.LastDurationIs(publisher, StandardDelayMillis);
        }
コード例 #7
0
        public async Task CorrectDurationForStatInAsyncFunction()
        {
            var publisher = new FakeStatsPublisher();
            await publisher.Time("stat", async () => await DelayedAnswerAsync());

            PublisherAssertions.LastDurationIs(publisher, StandardDelayMillis);
        }
コード例 #8
0
        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");
        }
コード例 #9
0
        public async Task CanRecordStatInAsyncAction()
        {
            var publisher = new FakeStatsPublisher();
            await publisher.Time("statOverAsyncAction", async () => await DelayAsync());

            PublisherAssertions.SingleStatNameIs(publisher, "statOverAsyncAction");
        }
コード例 #10
0
        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);
        }