File tree Expand file tree Collapse file tree 5 files changed +566
-2
lines changed
src/ResourceManager/Resources
SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceGroupTests Expand file tree Collapse file tree 5 files changed +566
-2
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,14 @@ RequiredAssemblies = @()
54
54
ScriptsToProcess = @ ()
55
55
56
56
# Type files (.ps1xml) to be loaded when importing this module
57
- TypesToProcess = @ ()
57
+ TypesToProcess = @ (
58
+ ' Microsoft.Azure.Commands.ResourceManager.Cmdlets.Types.ps1xml'
59
+ )
58
60
59
61
# Format files (.ps1xml) to be loaded when importing this module
60
62
FormatsToProcess = @ (
61
- ' .\Microsoft.Azure.Commands.Resources.format.ps1xml'
63
+ ' .\Microsoft.Azure.Commands.Resources.format.ps1xml' ,
64
+ ' .\Microsoft.Azure.Commands.ResourceManager.Cmdlets.format.ps1xml'
62
65
)
63
66
64
67
# Modules to import as nested modules of the module specified in ModuleToProcess
Original file line number Diff line number Diff line change 402
402
<None Include =" SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceGroupTests\TestRemoveNonExistingResourceGroup.json" >
403
403
<CopyToOutputDirectory >Always</CopyToOutputDirectory >
404
404
</None >
405
+ <None Include =" SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceGroupTests\TestResourceGroupWithPositionalParams.json" >
406
+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
407
+ </None >
405
408
<None Include =" SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceGroupTests\TestUpdatesExistingResourceGroup.json" >
406
409
<CopyToOutputDirectory >Always</CopyToOutputDirectory >
407
410
</None >
Original file line number Diff line number Diff line change @@ -76,6 +76,13 @@ public void TestExportResourceGroup()
76
76
ResourcesController . NewInstance . RunPsTest ( "Test-ExportResourceGroup" ) ;
77
77
}
78
78
79
+ [ Fact ]
80
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
81
+ public void TestResourceGroupWithPositionalParams ( )
82
+ {
83
+ ResourcesController . NewInstance . RunPsTest ( "Test-ResourceGroupWithPositionalParams" ) ;
84
+ }
85
+
79
86
[ Fact ( Skip = "TODO: Fix the broken test." ) ]
80
87
public void TestAzureTagsEndToEnd ( )
81
88
{
Original file line number Diff line number Diff line change @@ -350,4 +350,34 @@ function Test-ExportResourceGroup
350
350
# Cleanup
351
351
Clean - ResourceGroup $rgname
352
352
}
353
+ }
354
+
355
+ <#
356
+ . SYNOPSIS
357
+ Tests resource group new, get and remove using positional parameters.
358
+ #>
359
+ function Test-ResourceGroupWithPositionalParams
360
+ {
361
+ # Setup
362
+ $rgname = Get-ResourceGroupName
363
+ $location = " West US"
364
+
365
+ try
366
+ {
367
+ $ErrorActionPreference = " SilentlyContinue"
368
+ $Error.Clear ()
369
+ # Test
370
+ $actual = New-AzureRmResourceGroup $rgname $location
371
+ $expected = Get-AzureRmResourceGroup $rgname
372
+
373
+ # Assert
374
+ Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName
375
+
376
+ # Test
377
+ Remove-AzureRmResourceGroup $rgname - Force
378
+ }
379
+ catch
380
+ {
381
+ Assert-True { $Error [0 ].Contains(" Provided resource group does not exist." ) }
382
+ }
353
383
}
You can’t perform that action at this time.
0 commit comments