/** * Runs the test. * @param collection collection of resources to test * @param resourceGroups the resource groups collection * @throws Exception if anything goes wrong */ public void RunTest(C collection, IResourceGroups resourceGroups) { this.collection = collection; this.resourceGroups = resourceGroups; // Initial listing int initialCount = VerifyListing(); // Verify creation resource = CreateResource(collection); TestHelper.WriteLine("\n------------\nAfter creation:\n"); Print(resource); // Verify listing VerifyListing(); // Verify getting resource = VerifyGetting(); Assert.NotNull(resource); TestHelper.WriteLine("\n------------\nRetrieved resource:\n"); Print(resource); // Verify update resource = UpdateResource(resource); Assert.NotNull(resource); TestHelper.WriteLine("\n------------\nUpdated resource:\n"); Print(resource); // Verify deletion VerifyDeleting(); }
public KaUtil(AzureCredentials credential, string subscription, TimeSpan timeout) { this.resourceGroups = ResourceManager.Authenticate(credential).WithSubscription(subscription).ResourceGroups; this.computeUsages = ComputeManager.Authenticate(credential, subscription).Usages; this.cleanupTimeout = timeout; }