File tree Expand file tree Collapse file tree 4 files changed +728
-0
lines changed
src/ResourceManager/Websites/Commands.Websites.Test
SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AppServicePlanTests Expand file tree Collapse file tree 4 files changed +728
-0
lines changed Original file line number Diff line number Diff line change 171
171
<None Include =" SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AppServicePlanTests\TestCreateNewAppServicePlan.json" >
172
172
<CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
173
173
</None >
174
+ <None Include =" SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AppServicePlanTests\TestCreateNewAppServicePlanInAse.json" >
175
+ <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
176
+ </None >
174
177
<None Include =" SessionRecords\Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AppServicePlanTests\TestGetAppServicePlan.json" >
175
178
<CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
176
179
</None >
Original file line number Diff line number Diff line change @@ -55,5 +55,12 @@ public void TestGetAppServicePlanMetrics()
55
55
{
56
56
WebsitesController . NewInstance . RunPsTest ( "Test-GetAppServicePlanMetrics" ) ;
57
57
}
58
+
59
+ [ Fact ]
60
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
61
+ public void TestCreateNewAppServicePlanInAse ( )
62
+ {
63
+ WebsitesController . NewInstance . RunPsTest ( "Test-CreateNewAppServicePlanInAse" ) ;
64
+ }
58
65
}
59
66
}
Original file line number Diff line number Diff line change @@ -309,4 +309,49 @@ function Test-GetAppServicePlanMetrics
309
309
Remove-AzureRmAppServicePlan - ResourceGroupName $rgname - Name $appServicePlanName - Force
310
310
Remove-AzureRmResourceGroup - Name $rgname - Force
311
311
}
312
+ }
313
+
314
+ <#
315
+ . SYNOPSIS
316
+ Tests creating a new Web Hosting Plan.
317
+ #>
318
+ function Test-CreateNewAppServicePlanInAse
319
+ {
320
+ # Setup
321
+ $rgname = Get-ResourceGroupName
322
+ $whpName = Get-WebHostPlanName
323
+ $location = " West US"
324
+ $capacity = 1
325
+ $skuName = " S2"
326
+ $aseName = " asedemo"
327
+ $aseResourceGroupName = " appdemorg"
328
+
329
+ try
330
+ {
331
+ # Setup
332
+ New-AzureRmResourceGroup - Name $rgname - Location $location
333
+
334
+ # Test
335
+ $createResult = New-AzureRmAppServicePlan - ResourceGroupName $rgname - Name $whpName - Location $location - Tier " Standard" - WorkerSize Medium - NumberOfWorkers $capacity - AseName $aseName - AseResourceGroupName $aseResourceGroupName
336
+
337
+ # Assert
338
+ Assert-AreEqual $whpName $createResult.Name
339
+ Assert-AreEqual " Standard" $createResult.Sku.Tier
340
+ Assert-AreEqual $skuName $createResult.Sku.Name
341
+ Assert-AreEqual $capacity $createResult.Sku.Capacity
342
+
343
+ # Assert
344
+
345
+ $getResult = Get-AzureRmAppServicePlan - ResourceGroupName $rgname - Name $whpName
346
+ Assert-AreEqual $whpName $getResult.Name
347
+ Assert-AreEqual " Standard" $getResult.Sku.Tier
348
+ Assert-AreEqual $skuName $getResult.Sku.Name
349
+ Assert-AreEqual $capacity $getResult.Sku.Capacity
350
+ }
351
+ finally
352
+ {
353
+ # Cleanup
354
+ Remove-AzureRmAppServicePlan - ResourceGroupName $rgname - Name $whpName - Force
355
+ Remove-AzureRmResourceGroup - Name $rgname - Force
356
+ }
312
357
}
You can’t perform that action at this time.
0 commit comments