public void ValidateExceptionOperation() { ManagementTestClient client = InstrumentClient(new ManagementTestClient()); TestResourceOperations rgOp = client.GetTestResourceOperations(); Assert.ThrowsAsync(typeof(ArgumentException), async() => await rgOp.GetArmOperationExceptionAsync()); }
public void ValidateInstrumentGetOperations() { ManagementTestClient client = InstrumentClient(new ManagementTestClient()); var testResource = client.GetTestResourceOperations(); Assert.AreEqual("TestResourceOperationsProxy", testResource.GetType().Name); Assert.AreEqual("success", testResource.Method()); }
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()); }
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()); }
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"); }
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()); }