Exemple #1
0
        public async Task ValidateStartLroWrapper()
        {
            ManagementTestClient client = InstrumentClient(new ManagementTestClient());
            TestResource         rgOp   = client.GetTestResource();
            var testResourceOp          = await rgOp.StartLroWrapperAsync(WaitUntil.Completed);

            TestResource testResource = await testResourceOp.WaitForCompletionAsync();

            Assert.AreEqual("TestResourceProxy", testResource.GetType().Name);
            Assert.AreEqual("success", testResource.Method());
        }
Exemple #2
0
        public async Task ValidateStartSkipWait()
        {
            ManagementTestClient client = InstrumentClient(new ManagementTestClient());
            TestResource         rgOp   = client.GetTestResource();
            var testResourceOp          = await rgOp.StartLroWrapperAsync(WaitUntil.Completed);

            Stopwatch    timer        = Stopwatch.StartNew();
            TestResource testResource = await testResourceOp.WaitForCompletionAsync();

            timer.Stop();
            //method waits for 10 seconds so timer should easily be less than half of that if we skip
            Assert.IsTrue(timer.ElapsedMilliseconds < 5000, $"WaitForCompletion took {timer.ElapsedMilliseconds}ms");
        }