コード例 #1
0
        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());
            }
        }
コード例 #2
0
        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);
            }
        }