コード例 #1
0
        private async Task WCFReadMeasurementsAsync(MeasurementQueryModel q, int expectedCount)
        {
            MeasurementsServiceClient client = new MeasurementsServiceClient();

            Stopwatch sw     = Stopwatch.StartNew();
            var       result = await client.GetMeasurementsAsync(q);

            sw.Stop();
            client.Close();

            Trace.WriteLine(string.Format("GetMeasurements with query {0} took {1} ms and returned {2} results.", GetQueryString(q), sw.ElapsedMilliseconds, result.Length));
            Assert.IsNotNull(result);
            Assert.AreEqual(expectedCount, result.Length);
        }
コード例 #2
0
        public async Task WCFReadMeasurementsTop100Async()
        {
            int expected            = 100;
            MeasurementQueryModel q = new MeasurementQueryModel()
            {
                Key  = TestHelper.TestKey,
                Take = expected
            };

            MeasurementsServiceClient client = new MeasurementsServiceClient();

            Stopwatch sw     = Stopwatch.StartNew();
            var       result = await client.GetMeasurementsAsync(q);

            sw.Stop();
            client.Close();

            Trace.WriteLine(string.Format("GetMeasurements (async) with query {0} took {1} ms and returned {2} results.", GetQueryString(q), sw.ElapsedMilliseconds, result.Length));
            Assert.IsNotNull(result);
            Assert.AreEqual(expected, result.Length);
        }