public void HealthcareApisListAccountByResourceGroupTest() { var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; using (MockContext context = MockContext.Start(this.GetType())) { var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); // Create resource group var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); var accounts = healthCareApisMgmtClient.Workspaces.ListByResourceGroup(rgname); Assert.Empty(accounts); string accountName1 = HealthcareApisManagementTestUtilities.CreateHealthcareApisAccount(healthCareApisMgmtClient, rgname); string accountName2 = HealthcareApisManagementTestUtilities.CreateHealthcareApisAccount(healthCareApisMgmtClient, rgname); accounts = healthCareApisMgmtClient.Workspaces.ListByResourceGroup(rgname); Assert.Equal(2, accounts.Count()); HealthcareApisManagementTestUtilities.VerifyWorkspaceProperties(accounts.First()); HealthcareApisManagementTestUtilities.VerifyWorkspaceProperties(accounts.Skip(1).First()); } }
public void HealthcareApisCreateTest() { var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; using (MockContext context = MockContext.Start(this.GetType())) { var resourcesClient = HealthcareApisManagementTestUtilities.GetResourceManagementClient(context, handler); var healthCareApisMgmtClient = HealthcareApisManagementTestUtilities.GetHealthcareApisManagementClient(context, handler); // Create resource group var rgname = HealthcareApisManagementTestUtilities.CreateResourceGroup(resourcesClient); // Generate account name string accountName = TestUtilities.GenerateName("hca"); var workspace = HealthcareApisManagementTestUtilities.GetWorkspace(); // Create healthcare apis account var account = healthCareApisMgmtClient.Workspaces.BeginCreateOrUpdate(rgname, accountName, workspace); HealthcareApisManagementTestUtilities.VerifyWorkspaceProperties(account); } }