File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Common/Commands.Common.Test/Common
ResourceManager/Resources/Commands.Resources/Models.ResourceGroups Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -499,7 +499,7 @@ public void SelectDefaultAzureSubscriptionByNameUpdatesProfile()
499
499
[ Fact ]
500
500
public void SelectAzureSubscriptionByNameUpdatesProfile ( )
501
501
{
502
- var profileClient = SetupDefaultProfile ( ) ;
502
+ SetupDefaultProfile ( ) ;
503
503
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand ( ) ;
504
504
505
505
// Setup
@@ -511,10 +511,10 @@ public void SelectAzureSubscriptionByNameUpdatesProfile()
511
511
cmdlt . InvokeBeginProcessing ( ) ;
512
512
cmdlt . ExecuteCmdlet ( ) ;
513
513
cmdlt . InvokeEndProcessing ( ) ;
514
-
514
+
515
515
// Verify
516
- Assert . NotNull ( profileClient . Profile . Context . Subscription ) ;
517
- Assert . Equal ( azureSubscription2 . Id , profileClient . Profile . Context . Subscription . Id ) ;
516
+ Assert . NotNull ( cmdlt . Profile . Context . Subscription ) ;
517
+ Assert . Equal ( azureSubscription2 . Id , cmdlt . Profile . Context . Subscription . Id ) ;
518
518
}
519
519
520
520
[ Fact ]
Original file line number Diff line number Diff line change 13
13
// ----------------------------------------------------------------------------------
14
14
15
15
using Microsoft . Azure . Commands . Resources . Models . Authorization ;
16
+ using Microsoft . Azure . Common . Authentication ;
17
+ using Microsoft . Azure . Common . Authentication . Models ;
16
18
using Microsoft . WindowsAzure . Commands . Utilities . Common ;
19
+ using System . IO ;
17
20
18
21
namespace Microsoft . Azure . Commands . Resources . Models
19
22
{
@@ -50,6 +53,11 @@ public GalleryTemplatesClient GalleryTemplatesClient
50
53
{
51
54
if ( galleryTemplatesClient == null )
52
55
{
56
+ if ( Profile == null )
57
+ {
58
+ Profile = new AzureProfile ( Path . Combine ( AzureSession . ProfileDirectory , AzureSession . ProfileFile ) ) ;
59
+ }
60
+
53
61
galleryTemplatesClient = new GalleryTemplatesClient ( Profile . Context ) ;
54
62
}
55
63
return galleryTemplatesClient ;
You can’t perform that action at this time.
0 commit comments