Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.HealthcareApis" Version="1.0.2" />
<PackageReference Include="Microsoft.Azure.Management.HealthcareApis" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\HealthcareApis\HealthcareApis.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="SessionRecords\Microsoft.Azure.Commands.HealthcareApisService.Test.ScenarioTests.HealthcareApisServiceTests\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Gets valid location name
#>
function Get-Location
{
return "West US"
return "southcentralus"
}

<#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Microsoft.Azure.Commands.HealthcareApisService.Test.ScenarioTests
using ServiceManagement.Common.Models;
using TestEnvironmentFactory = Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory;

public sealed class HeathcareApisServiceController
public sealed class HealthcareApisServiceController
{
private readonly EnvironmentSetupHelper _helper;

Expand All @@ -40,9 +40,9 @@ public sealed class HeathcareApisServiceController

public GraphRbacManagementClient GraphRbacManagementClient { get; set; }

public static HeathcareApisServiceController NewInstance => new HeathcareApisServiceController();
public static HealthcareApisServiceController NewInstance => new HealthcareApisServiceController();

public HeathcareApisServiceController()
public HealthcareApisServiceController()
{
_helper = new EnvironmentSetupHelper();
}
Expand Down Expand Up @@ -138,9 +138,5 @@ private static GraphRbacManagementClient GetGraphRBACManagementClient(MockContex
{
return context.GetServiceClient<GraphRbacManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}




}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public HealthcareApisServiceTests(ITestOutputHelper output)
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAzRmHealthcareApisService()
{
HeathcareApisServiceController.NewInstance.RunPsTest(_logger, "Test-AzRmHealthcareApisService");
HealthcareApisServiceController.NewInstance.RunPsTest(_logger, "Test-AzRmHealthcareApisService");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,49 @@ function Test-AzRmHealthcareApisService{
$offerThroughput = Get-OfferThroughput
$kind = Get-Kind
$object_id = Get-AccessPolicyObjectID;
$storageAccountName = "exportStorage"

try
{
# Test
# Create Resource Group
New-AzResourceGroup -Name $rgname -Location $location

# Create App

$created = New-AzHealthcareApisService -Name $rname -ResourceGroupName $rgname -Location $location -Kind $kind -AccessPolicyObjectId $object_id -CosmosOfferThroughput $offerThroughput;
# Create App
$created = New-AzHealthcareApisService -Name $rname -ResourceGroupName $rgname -Location $location -Kind $kind -CosmosOfferThroughput $offerThroughput -ManagedIdentity -ExportStorageAccountName $storageAccountName;

$actual = Get-AzHealthcareApisService -ResourceGroupName $rgname -Name $rname

# Assert
Assert-AreEqual $actual.Name $rname
Assert-AreEqual $actual.CosmosDbOfferThroughput $offerThroughput
Assert-AreEqual $actual.Kind $kind
Assert-AreEqual $rname $actual.Name
Assert-AreEqual $offerThroughput $actual.CosmosDbOfferThroughput
Assert-AreEqual $kind $actual.Kind
Assert-AreEqual "https://$rname.azurehealthcareapis.com" $actual.Audience
Assert-AreEqual $storageAccountName $actual.ExportStorageAccountName
Assert-AreEqual "SystemAssigned" $actual.IdentityType
Assert-NotNull $actual.IdentityPrincipalId
Assert-NotNull $actual.IdentityTenantId

#Update using parameters
$newOfferThroughput = $offerThroughput - 600
$updated = Set-AzHealthcareApisService -ResourceId $actual.Id -CosmosOfferThroughput $newOfferThroughput;
$updated = Set-AzHealthcareApisService -ResourceId $actual.Id -CosmosOfferThroughput $newOfferThroughput -DisableManagedIdentity;

$updatedAccount = Get-AzHealthcareApisService -ResourceGroupName $rgname -Name $rname

# Assert the update
Assert-AreEqual $updatedAccount.Name $rname
Assert-AreEqual $updatedAccount.CosmosDbOfferThroughput $newOfferThroughput
Assert-AreEqual $rname $updatedAccount.Name
Assert-AreEqual $newOfferThroughput $updatedAccount.CosmosDbOfferThroughput
Assert-AreEqual "None" $updatedAccount.IdentityType

# Create second App
$rname1 = $rname + "1"
$created1 = New-AzHealthcareApisService -Name $rname1 -ResourceGroupName $rgname -Location $location -AccessPolicyObjectId $object_id -CosmosOfferThroughput $offerThroughput;
$created1 = New-AzHealthcareApisService -Name $rname1 -ResourceGroupName $rgname -Location $location -AccessPolicyObjectId $object_id -CosmosOfferThroughput $offerThroughput;

$actual1 = Get-AzHealthcareApisService -ResourceGroupName $rgname -Name $rname1

# Assert
Assert-AreEqual $actual1.Name $rname1
Assert-AreEqual $actual1.CosmosDbOfferThroughput $offerThroughput
Assert-AreEqual $rname1 $actual1.Name
Assert-AreEqual $offerThroughput $actual1.CosmosDbOfferThroughput

$list = Get-AzHealthcareApisService -ResourceGroupName $rgname

Expand Down
Loading