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 = @()
5454ScriptsToProcess = @ ()
5555
5656# Type files (.ps1xml) to be loaded when importing this module
57- TypesToProcess = @ ()
57+ TypesToProcess = @ (
58+ ' Microsoft.Azure.Commands.ResourceManager.Cmdlets.Types.ps1xml'
59+ )
5860
5961# Format files (.ps1xml) to be loaded when importing this module
6062FormatsToProcess = @ (
61- ' .\Microsoft.Azure.Commands.Resources.format.ps1xml'
63+ ' .\Microsoft.Azure.Commands.Resources.format.ps1xml' ,
64+ ' .\Microsoft.Azure.Commands.ResourceManager.Cmdlets.format.ps1xml'
6265)
6366
6467# Modules to import as nested modules of the module specified in ModuleToProcess
Original file line number Diff line number Diff line change 399399 <None Include =" SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceGroupTests\TestRemoveNonExistingResourceGroup.json" >
400400 <CopyToOutputDirectory >Always</CopyToOutputDirectory >
401401 </None >
402+ <None Include =" SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceGroupTests\TestResourceGroupWithPositionalParams.json" >
403+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
404+ </None >
402405 <None Include =" SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceGroupTests\TestUpdatesExistingResourceGroup.json" >
403406 <CopyToOutputDirectory >Always</CopyToOutputDirectory >
404407 </None >
Original file line number Diff line number Diff line change @@ -76,6 +76,13 @@ public void TestExportResourceGroup()
7676 ResourcesController . NewInstance . RunPsTest ( "Test-ExportResourceGroup" ) ;
7777 }
7878
79+ [ Fact ]
80+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
81+ public void TestResourceGroupWithPositionalParams ( )
82+ {
83+ ResourcesController . NewInstance . RunPsTest ( "Test-ResourceGroupWithPositionalParams" ) ;
84+ }
85+
7986 [ Fact ( Skip = "TODO: Fix the broken test." ) ]
8087 public void TestAzureTagsEndToEnd ( )
8188 {
Original file line number Diff line number Diff line change @@ -350,4 +350,34 @@ function Test-ExportResourceGroup
350350 # Cleanup
351351 Clean - ResourceGroup $rgname
352352 }
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+ }
353383}
You can’t perform that action at this time.
0 commit comments