@@ -21,7 +21,7 @@ function Test-RoleDefinitionCreateTests
21
21
# Setup
22
22
# Basic positive case - read from file
23
23
$rdName = ' CustomRole Tests Role'
24
- New-AzureRmRoleDefinitionWithId - InputFile . \Resources\NewRoleDefinition.json - RoleDefinitionId ee78fa8a- 3cdd- 418e - a4d8- 949b57a33dcd
24
+ New-AzureRmRoleDefinitionWithId - InputFile " $TestOutputRoot \Resources\NewRoleDefinition.json" - RoleDefinitionId ee78fa8a- 3cdd- 418e - a4d8- 949b57a33dcd
25
25
26
26
$rd = Get-AzureRmRoleDefinition - Name $rdName
27
27
Assert-AreEqual " Test role" $rd.Description
@@ -70,7 +70,7 @@ function Test-RdNegativeScenarios
70
70
$badIdException = " Cannot find role definition with id '" + $rdId + " '."
71
71
72
72
# Throws on trying to update the a role that does not exist
73
- Assert-Throws { Set-AzureRmRoleDefinition - InputFile . \Resources\RoleDefinition.json } $badIdException
73
+ Assert-Throws { Set-AzureRmRoleDefinition - InputFile " $TestOutputRoot \Resources\RoleDefinition.json" } $badIdException
74
74
75
75
# Role Defintion not provided.
76
76
$roleDefNotProvided = " Parameter set cannot be resolved using the specified named parameters."
@@ -84,7 +84,7 @@ function Test-RdNegativeScenarios
84
84
# Role not provided.
85
85
$roleDefNotProvided = " Cannot validate argument on parameter 'Role'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again."
86
86
Assert-Throws { Set-AzureRmRoleDefinition - Role $rdNull } $roleDefNotProvided
87
- Assert-Throws { Set-AzureRmRoleDefinition - InputFile . \Resources\RoleDefinition.json - Role $rd } $roleDefNotProvided
87
+ Assert-Throws { Set-AzureRmRoleDefinition - InputFile " $TestOutputRoot \Resources\RoleDefinition.json" - Role $rd } $roleDefNotProvided
88
88
89
89
# TODO add check for valid input file and valid role
90
90
@@ -103,7 +103,7 @@ function Test-RDPositiveScenarios
103
103
# Setup
104
104
# Create a role definition with Name rdNamme.
105
105
$rdName = ' Another tests role'
106
- $rd = New-AzureRmRoleDefinitionWithId - InputFile . \Resources\RoleDefinition.json - RoleDefinitionId 0a0e83bc- 50b9- 4c4d- b2c2- 3f41e1a8baf2
106
+ $rd = New-AzureRmRoleDefinitionWithId - InputFile " $TestOutputRoot \Resources\RoleDefinition.json" - RoleDefinitionId 0a0e83bc- 50b9- 4c4d- b2c2- 3f41e1a8baf2
107
107
$rd = Get-AzureRmRoleDefinition - Name $rdName
108
108
109
109
# Update the role definition with action that was created in the step above.
@@ -129,7 +129,7 @@ function Test-RDUpdate
129
129
130
130
# Create a role definition with Name rdNamme.
131
131
$rdName = ' Another tests role'
132
- $rd = New-AzureRmRoleDefinitionWithId - InputFile . \Resources\RoleDefinition.json - RoleDefinitionId 3d95b97a- 5745 - 4c39- 950c- 0b608dea635f
132
+ $rd = New-AzureRmRoleDefinitionWithId - InputFile " $TestOutputRoot \Resources\RoleDefinition.json" - RoleDefinitionId 3d95b97a- 5745 - 4c39- 950c- 0b608dea635f
133
133
$rd = Get-AzureRmRoleDefinition - Name $rdName
134
134
135
135
# Update the role definition with action that was created in the step above.
@@ -158,7 +158,7 @@ function Test-RDCreateFromFile
158
158
$badScopeException = " Exception calling `" ExecuteCmdlet`" with `" 0`" argument(s): `" Scope '/subscriptions/4004a9fd-d58e-48dc-aeb2-4a4aec58606f/ResourceGroups' should have even number of parts.`" "
159
159
try
160
160
{
161
- $rd = New-AzureRmRoleDefinitionWithId - InputFile . \Resources\InvalidRoleDefinition.json - RoleDefinitionId 4482e4d1- 8757 - 4d67- b3c1- 5c8ccee3fdcc
161
+ $rd = New-AzureRmRoleDefinitionWithId - InputFile " $TestOutputRoot \Resources\InvalidRoleDefinition.json" - RoleDefinitionId 4482e4d1- 8757 - 4d67- b3c1- 5c8ccee3fdcc
162
162
Assert-AreEqual " This assertion shouldn't be hit'" " New-AzureRmRoleDefinition should've thrown an exception"
163
163
}
164
164
catch
@@ -280,7 +280,7 @@ function Test-RoleDefinitionDataActionsCreateTests
280
280
# Setup
281
281
# Basic positive case - read from file
282
282
$rdName = ' CustomRole Tests Role New'
283
- New-AzureRmRoleDefinitionWithId - InputFile . \Resources\DataActionsRoleDefinition.json - RoleDefinitionId e3efe8c9- d9ae- 4f0e- 838d - 57ce43068a13
283
+ New-AzureRmRoleDefinitionWithId - InputFile " $TestOutputRoot \Resources\DataActionsRoleDefinition.json" - RoleDefinitionId e3efe8c9- d9ae- 4f0e- 838d - 57ce43068a13
284
284
285
285
$rd = Get-AzureRmRoleDefinition - Name $rdName
286
286
Assert-AreEqual " Test role" $rd.Description
@@ -322,7 +322,7 @@ function Test-RDGetCustomRoles
322
322
# Setup
323
323
# Basic positive case - read from file
324
324
$rdName = ' Another tests role'
325
- $rd = New-AzureRmRoleDefinitionWithId - InputFile . \Resources\RoleDefinition.json - RoleDefinitionId 3d95b97a- 5745 - 4c39- 950c- 0b608dea635f
325
+ $rd = New-AzureRmRoleDefinitionWithId - InputFile " $TestOutputRoot \Resources\RoleDefinition.json" - RoleDefinitionId 3d95b97a- 5745 - 4c39- 950c- 0b608dea635f
326
326
$rd = Get-AzureRmRoleDefinition - Name $rdName
327
327
328
328
$roles = Get-AzureRmRoleDefinition - Custom
@@ -437,7 +437,7 @@ function Test-RDDataActionsNegativeTestCases
437
437
# Setup
438
438
# Basic positive case - read from file
439
439
$rdName = ' Another tests role'
440
- $rd = New-AzureRmRoleDefinitionWithId - InputFile . \Resources\RoleDefinition.json - RoleDefinitionId 3d95b97a- 5745 - 4c39- 950c- 0b608dea635f
440
+ $rd = New-AzureRmRoleDefinitionWithId - InputFile " $TestOutputRoot \Resources\RoleDefinition.json" - RoleDefinitionId 3d95b97a- 5745 - 4c39- 950c- 0b608dea635f
441
441
$rd = Get-AzureRmRoleDefinition - Name $rdName
442
442
443
443
$createdRole = Get-AzureRmRoleDefinition - Name $rdName
0 commit comments