Skip to content

Commit

Permalink
Merge pull request #1 from vivsriaus/AddRGTest
Browse files Browse the repository at this point in the history
Add RG positional params test, update RM manifest to include RGDO for…
  • Loading branch information
ravbhatnagar committed Apr 26, 2016
2 parents a42d12d + 54ac658 commit c951c29
Show file tree
Hide file tree
Showing 5 changed files with 566 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ResourceManager/Resources/AzureRM.Resources.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,14 @@ RequiredAssemblies = @()
ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
TypesToProcess = @()
TypesToProcess = @(
'Microsoft.Azure.Commands.ResourceManager.Cmdlets.Types.ps1xml'
)

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @(
'.\Microsoft.Azure.Commands.Resources.format.ps1xml'
'.\Microsoft.Azure.Commands.Resources.format.ps1xml',
'.\Microsoft.Azure.Commands.ResourceManager.Cmdlets.format.ps1xml'
)

# Modules to import as nested modules of the module specified in ModuleToProcess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceGroupTests\TestRemoveNonExistingResourceGroup.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceGroupTests\TestResourceGroupWithPositionalParams.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceGroupTests\TestUpdatesExistingResourceGroup.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ public void TestExportResourceGroup()
ResourcesController.NewInstance.RunPsTest("Test-ExportResourceGroup");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestResourceGroupWithPositionalParams()
{
ResourcesController.NewInstance.RunPsTest("Test-ResourceGroupWithPositionalParams");
}

[Fact (Skip = "TODO: Fix the broken test.")]
public void TestAzureTagsEndToEnd()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,34 @@ function Test-ExportResourceGroup
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Tests resource group new, get and remove using positional parameters.
#>
function Test-ResourceGroupWithPositionalParams
{
# Setup
$rgname = Get-ResourceGroupName
$location = "West US"

try
{
$ErrorActionPreference = "SilentlyContinue"
$Error.Clear()
# Test
$actual = New-AzureRmResourceGroup $rgname $location
$expected = Get-AzureRmResourceGroup $rgname

# Assert
Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName

#Test
Remove-AzureRmResourceGroup $rgname -Force
}
catch
{
Assert-True { $Error[0].Contains("Provided resource group does not exist.") }
}
}
Loading

0 comments on commit c951c29

Please sign in to comment.