Skip to content

Commit 677fd4a

Browse files
authored
Merge pull request #4416 from darshanhs90/preview
remove resources.dll as it isnt needed
2 parents e880c23 + 64aec38 commit 677fd4a

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/RoleAssignmentTests.ps1

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Tests retrieval of classic administrators
1919
function Test-RaClassicAdmins
2020
{
2121
# Setup
22-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
2322
$subscription = Get-AzureRmSubscription
2423

2524
# Test
@@ -37,8 +36,6 @@ Tests verifies negative scenarios for RoleAssignments
3736
function Test-RaNegativeScenarios
3837
{
3938
# Setup
40-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
41-
4239
$subscription = Get-AzureRmSubscription
4340

4441
# Bad OID returns zero role assignments
@@ -66,8 +63,6 @@ Tests verifies creation and deletion of a RoleAssignments by Scope
6663
function Test-RaByScope
6764
{
6865
# Setup
69-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
70-
7166
$definitionName = 'Reader'
7267
$users = Get-AzureRmADUser | Select-Object -First 1 -Wait
7368
$subscription = Get-AzureRmSubscription
@@ -101,8 +96,6 @@ Tests verifies creation and deletion of a RoleAssignments by Resource Group
10196
function Test-RaByResourceGroup
10297
{
10398
# Setup
104-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
105-
10699
$definitionName = 'Contributor'
107100
$users = Get-AzureRmADUser | Select-Object -Last 1 -Wait
108101
$resourceGroups = Get-AzureRmResourceGroup | Select-Object -Last 1 -Wait
@@ -134,8 +127,6 @@ Tests verifies creation and deletion of a RoleAssignments by Resource
134127
function Test-RaByResource
135128
{
136129
# Setup
137-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
138-
139130
$definitionName = 'Owner'
140131
$groups = Get-AzureRmADGroup | Select-Object -Last 1 -Wait
141132
Assert-AreEqual 1 $groups.Count "There should be at least one group to run the test."
@@ -171,8 +162,6 @@ Tests validate input parameters
171162
function Test-RaValidateInputParameters ($cmdName)
172163
{
173164
# Setup
174-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
175-
176165
$definitionName = 'Owner'
177166
$groups = Get-AzureRmADGroup | Select-Object -Last 1 -Wait
178167
Assert-AreEqual 1 $groups.Count "There should be at least one group to run the test."
@@ -224,8 +213,6 @@ Tests verifies creation and deletion of a RoleAssignments for Service principal
224213
function Test-RaByServicePrincipal
225214
{
226215
# Setup
227-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
228-
229216
$definitionName = 'Reader'
230217
$servicePrincipals = Get-AzureRmADServicePrincipal | Select-Object -Last 1 -Wait
231218
$subscription = Get-AzureRmSubscription
@@ -260,8 +247,6 @@ Tests verifies creation and deletion of a RoleAssignments for User Principal Nam
260247
function Test-RaByUpn
261248
{
262249
# Setup
263-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
264-
265250
$definitionName = 'Contributor'
266251
$users = Get-AzureRmADUser | Select-Object -Last 1 -Wait
267252
$resourceGroups = Get-AzureRmResourceGroup | Select-Object -Last 1 -Wait
@@ -290,9 +275,6 @@ function Test-RaByUpn
290275
function Test-RaUserPermissions
291276
{
292277
param([string]$rgName, [string]$action)
293-
294-
# Setup
295-
296278
# Test
297279
$rg = Get-AzureRmResourceGroup
298280
$errorMsg = "User should have access to only 1 RG. Found: {0}" -f $rg.Count
@@ -309,8 +291,6 @@ Tests verifies creation and deletion of a RoleAssignments by Scope irrespective
309291
function Test-RaDeletionByScope
310292
{
311293
# Setup
312-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
313-
314294
$definitionName = 'Reader'
315295
$users = Get-AzureRmADUser | Select-Object -First 1 -Wait
316296
$subscription = Get-AzureRmSubscription
@@ -346,8 +326,6 @@ function CreateRoleAssignment
346326
{
347327
param([string]$roleAssignmentId, [string]$userId, [string]$definitionName, [string]$resourceGroupName)
348328

349-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
350-
351329
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleAssignmentNames.Enqueue($roleAssignmentId)
352330
$newAssignment = New-AzureRmRoleAssignment `
353331
-ObjectId $userId `

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/RoleDefinitionTests.ps1

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ Tests verify scenarios for RoleDefinitions creation.
1919
function Test-RoleDefinitionCreateTests
2020
{
2121
# Setup
22-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
23-
2422
# Basic positive case - read from file
2523
$rdName = 'CustomRole Tests Role'
2624
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleDefinitionNames.Enqueue("8D7DD69E-9AE2-44A1-94D8-F7BC8E12645E")
@@ -62,8 +60,6 @@ Tests verify negative scenarios for RoleDefinitions
6260
function Test-RdNegativeScenarios
6361
{
6462
# Setup
65-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
66-
6763
# Does not throw when getting a non-existing role assignment
6864
$rdName = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
6965
$rdNull = Get-AzureRmRoleDefinition -Name $rdName
@@ -104,8 +100,6 @@ Tests verify positive scenarios for RoleDefinitions.
104100
function Test-RDPositiveScenarios
105101
{
106102
# Setup
107-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
108-
109103
# Create a role definition with Name rdNamme.
110104
$rdName = 'Another tests role'
111105
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleDefinitionNames.Enqueue("032F61D2-ED09-40C9-8657-26A273DA7BAE")
@@ -176,8 +170,6 @@ Verify positive and negative scenarios for RoleDefinition remove.
176170
function Test-RDRemove
177171
{
178172
# Setup
179-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
180-
181173
# Create a role definition at RG Scope.
182174
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleDefinitionNames.Enqueue("65E1D983-ECF4-42D4-8C08-5B1FD6E86335")
183175

@@ -217,8 +209,6 @@ Verify positive and negative scenarios for RoleDefinition Get.
217209
function Test-RDGet
218210
{
219211
# Setup
220-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
221-
222212
$subscription = Get-AzureRmSubscription
223213

224214
$resource = Get-AzureRmResource | Select-Object -Last 1 -Wait
@@ -289,8 +279,6 @@ Tests validate input parameters
289279
function Test-RdValidateInputParameters ($cmdName)
290280
{
291281
# Setup
292-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
293-
294282
# Note: All below scenarios are invalid, we'll expect an exception during scope validation so the ID parameter doesn't need to be a valid one.
295283

296284
# Test
@@ -324,8 +312,6 @@ Tests validate input parameters
324312
function Test-RdValidateInputParameters2 ($cmdName)
325313
{
326314
# Setup
327-
Add-Type -Path ".\\Microsoft.Azure.Commands.Resources.dll"
328-
329315
# Note: All below scenarios are invalid, we'll expect an exception during scope validation so the ID parameter doesn't need to be a valid one.
330316

331317
$roleDef = Get-AzureRmRoleDefinition -Name "Reader"

0 commit comments

Comments
 (0)