@@ -1180,9 +1180,9 @@ function Policy-CrudTest {
1180
1180
$set = Set-AzureRmApiManagementPolicy - Context $context - Policy $tenantValid - PassThru
1181
1181
Assert-AreEqual $true $set
1182
1182
1183
- Get-AzureRmApiManagementPolicy - Context $context - SaveAs ' TenantPolicy.xml' - Force
1184
- $exists = [System.IO.File ]::Exists(' TenantPolicy.xml' )
1185
- $policy = gc ' TenantPolicy.xml'
1183
+ Get-AzureRmApiManagementPolicy - Context $context - SaveAs " $TestOutputRoot / TenantPolicy.xml" - Force
1184
+ $exists = [System.IO.File ]::Exists(" $TestOutputRoot / TenantPolicy.xml" )
1185
+ $policy = gc " $TestOutputRoot / TenantPolicy.xml"
1186
1186
Assert-True {$policy -like ' *<find-and-replace from="aaa" to="BBB" />*' }
1187
1187
}
1188
1188
finally {
@@ -1200,9 +1200,9 @@ function Policy-CrudTest {
1200
1200
$set = Set-AzureRmApiManagementPolicy - Context $context - Policy $productValid - ProductId $product.ProductId - PassThru
1201
1201
Assert-AreEqual $true $set
1202
1202
1203
- Get-AzureRmApiManagementPolicy - Context $context - ProductId $product.ProductId - SaveAs ' ProductPolicy.xml' - Force
1204
- $exists = [System.IO.File ]::Exists(' ProductPolicy.xml' )
1205
- $policy = gc ' ProductPolicy.xml'
1203
+ Get-AzureRmApiManagementPolicy - Context $context - ProductId $product.ProductId - SaveAs " $TestOutputRoot / ProductPolicy.xml" - Force
1204
+ $exists = [System.IO.File ]::Exists(" $TestOutputRoot / ProductPolicy.xml" )
1205
+ $policy = gc " $TestOutputRoot / ProductPolicy.xml"
1206
1206
Assert-True {$policy -like ' *<rate-limit calls="5" renewal-period="60" />*' }
1207
1207
}
1208
1208
finally {
@@ -1213,7 +1213,7 @@ function Policy-CrudTest {
1213
1213
Assert-Null $policy
1214
1214
1215
1215
try {
1216
- rm ' ProductPolicy.xml'
1216
+ rm " $TestOutputRoot / ProductPolicy.xml"
1217
1217
}
1218
1218
catch {}
1219
1219
}
@@ -1225,9 +1225,9 @@ function Policy-CrudTest {
1225
1225
$set = Set-AzureRmApiManagementPolicy - Context $context - Policy $apiValid - ApiId $api.ApiId - PassThru
1226
1226
Assert-AreEqual $true $set
1227
1227
1228
- $policy = Get-AzureRmApiManagementPolicy - Context $context - ApiId $api.ApiId - SaveAs ' ApiPolicy.xml' - Force
1229
- $exists = [System.IO.File ]::Exists(' ApiPolicy.xml' )
1230
- $policy = gc ' ApiPolicy.xml'
1228
+ $policy = Get-AzureRmApiManagementPolicy - Context $context - ApiId $api.ApiId - SaveAs " $TestOutputRoot / ApiPolicy.xml" - Force
1229
+ $exists = [System.IO.File ]::Exists(" $TestOutputRoot / ApiPolicy.xml" )
1230
+ $policy = gc " $TestOutputRoot / ApiPolicy.xml"
1231
1231
Assert-True {$policy -like ' *<cache-lookup vary-by-developer="false" vary-by-developer-groups="false" downstream-caching-type="none">*' }
1232
1232
}
1233
1233
finally {
@@ -1238,7 +1238,7 @@ function Policy-CrudTest {
1238
1238
Assert-Null $policy
1239
1239
1240
1240
try {
1241
- rm ' ApiPolicy.xml'
1241
+ rm " $TestOutputRoot / ApiPolicy.xml"
1242
1242
}
1243
1243
catch {}
1244
1244
}
@@ -1253,9 +1253,9 @@ function Policy-CrudTest {
1253
1253
Assert-AreEqual $true $set
1254
1254
1255
1255
$policy = Get-AzureRmApiManagementPolicy - Context $context - ApiId $api.ApiId - OperationId $operation.OperationId `
1256
- - SaveAs ' OperationPolicy.xml' - Force
1257
- $exists = [System.IO.File ]::Exists(' OperationPolicy.xml' )
1258
- $policy = gc ' OperationPolicy.xml'
1256
+ - SaveAs " $TestOutputRoot / OperationPolicy.xml" - Force
1257
+ $exists = [System.IO.File ]::Exists(" $TestOutputRoot / OperationPolicy.xml" )
1258
+ $policy = gc " $TestOutputRoot / OperationPolicy.xml"
1259
1259
Assert-True {$policy -like ' *<rewrite-uri template="/resource" />*' }
1260
1260
}
1261
1261
finally {
@@ -1266,7 +1266,7 @@ function Policy-CrudTest {
1266
1266
Assert-Null $policy
1267
1267
1268
1268
try {
1269
- rm ' OperationPolicy.xml'
1269
+ rm " $TestOutputRoot / OperationPolicy.xml"
1270
1270
}
1271
1271
catch {}
1272
1272
}
0 commit comments