Beispiel #1
0
        public void ValidateExceptionOperation()
        {
            ManagementTestClient   client = InstrumentClient(new ManagementTestClient());
            TestResourceOperations rgOp   = client.GetTestResourceOperations();

            Assert.ThrowsAsync(typeof(ArgumentException), async() => await rgOp.GetArmOperationExceptionAsync());
        }
Beispiel #2
0
        public async Task ValidateExceptionOperationWaitForCompletion()
        {
            ManagementTestClient   client = InstrumentClient(new ManagementTestClient());
            TestResourceOperations rgOp   = client.GetTestResourceOperations();
            var testResourceOp            = await rgOp.GetArmOperationAsync(true);

            Assert.ThrowsAsync(typeof(ArgumentException), async() => await testResourceOp.WaitForCompletionAsync());
        }
Beispiel #3
0
        public async Task ValidateLroWrapper()
        {
            ManagementTestClient   client       = InstrumentClient(new ManagementTestClient());
            TestResourceOperations rgOp         = client.GetTestResourceOperations();
            TestResource           testResource = await rgOp.LroWrapperAsync();

            Assert.AreEqual("TestResourceProxy", testResource.GetType().Name);
            Assert.AreEqual("success", testResource.Method());
        }
Beispiel #4
0
        public async Task ValidateSkipWait()
        {
            ManagementTestClient   client = InstrumentClient(new ManagementTestClient());
            TestResourceOperations rgOp   = client.GetTestResourceOperations();
            Stopwatch    timer            = Stopwatch.StartNew();
            TestResource testResource     = await rgOp.LroWrapperAsync();

            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");
        }
Beispiel #5
0
        public async Task ValidateWaitForCompletion()
        {
            ManagementTestClient   client = InstrumentClient(new ManagementTestClient());
            TestResourceOperations rgOp   = client.GetTestResourceOperations();
            var testResourceOp            = await rgOp.GetArmOperationAsync();

            TestResource testResource = await testResourceOp.WaitForCompletionAsync();

            Assert.AreEqual("TestResourceProxy", testResource.GetType().Name);
            Assert.AreEqual("success", testResource.Method());
        }