Skip to content

Commit 17709b7

Browse files
committed
Minor Edits to Tests
- Typo fixes - Preserve Newest
1 parent 76b81fe commit 17709b7

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Commands.ApiManagement.ServiceManagement.Test.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@
232232
<None Include="SessionRecords\Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests\SubscriptionCrudTest.json">
233233
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
234234
</None>
235+
<None Include="SessionRecords\Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests\TenantAccessConfigurationCrudTest.json">
236+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
237+
</None>
235238
<None Include="SessionRecords\Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests\TenantGitConfigurationCrudTest.json">
236239
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
237240
</None>

src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTests.ps1

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ Param($resourceGroupName, $serviceName)
16831683

16841684
<#
16851685
.SYNOPSIS
1686-
Tests CRUD operations on Properties.
1686+
Tests CRUD operations on Tenant Git Configuration.
16871687
#>
16881688
function TenantGitConfiguration-CrudTest
16891689
{
@@ -1750,4 +1750,34 @@ Param($resourceGroupName, $serviceName)
17501750
{
17511751
Set-AzureRmApiManagementTenantGitAccess -Context $context -Enabled $false -PassThru
17521752
}
1753+
}
1754+
1755+
<#
1756+
.SYNOPSIS
1757+
Tests operations on Tenant Access.
1758+
#>
1759+
function TenantAccessConfiguration-CrudTest
1760+
{
1761+
Param($resourceGroupName, $serviceName)
1762+
1763+
$context = New-AzureRmApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName
1764+
1765+
try
1766+
{
1767+
$tenantAccess = Get-AzureRmApiManagementTenantAccess -Context $context
1768+
1769+
Assert-NotNull $tenantAccess
1770+
Assert-AreEqual $false $tenantAccess.Enabled
1771+
1772+
#enable Tenant Access
1773+
$tenantAccess = $null
1774+
$tenantAccess = Set-AzureRmApiManagementTenantAccess -Context $context -Enabled $true -PassThru
1775+
1776+
Assert-NotNull $tenantAccess
1777+
Assert-AreEqual $true $tenantAccess.Enabled
1778+
}
1779+
finally
1780+
{
1781+
Set-AzureRmApiManagementTenantAccess -Context $context -Enabled $false -PassThru
1782+
}
17531783
}

0 commit comments

Comments
 (0)