File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
Commands.Common.Authentication/Models
Microsoft.Azure.Commands.Profile/Profile
Microsoft.Azure.Commands.Profile.Test
StaticAnalysis/HelpGenerator Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,22 @@ public void Save()
103
103
/// <param name="path">File path on disk to save profile to</param>
104
104
public void Save ( string path )
105
105
{
106
+ Save ( _dataStore , path ) ;
107
+ }
108
+
109
+ public void Save ( IDataStore store , string path )
110
+ {
111
+
106
112
if ( string . IsNullOrEmpty ( path ) )
107
113
{
108
114
return ;
109
115
}
110
116
117
+ if ( store == null )
118
+ {
119
+ return ;
120
+ }
121
+
111
122
// Removing predefined environments
112
123
foreach ( string env in AzureEnvironment . PublicEnvironments . Keys )
113
124
{
@@ -118,14 +129,14 @@ public void Save(string path)
118
129
{
119
130
string contents = ToString ( ) ;
120
131
string diskContents = string . Empty ;
121
- if ( _dataStore . FileExists ( path ) )
132
+ if ( store . FileExists ( path ) )
122
133
{
123
- diskContents = _dataStore . ReadFileAsText ( path ) ;
134
+ diskContents = store . ReadFileAsText ( path ) ;
124
135
}
125
136
126
137
if ( diskContents != contents )
127
138
{
128
- _dataStore . WriteFile ( path , contents ) ;
139
+ store . WriteFile ( path , contents ) ;
129
140
}
130
141
}
131
142
finally
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ public void SaveAzureProfileInMemory()
107
107
profile . Environments . Add ( "foo" , AzureEnvironment . PublicEnvironments . Values . FirstOrDefault ( ) ) ;
108
108
SaveAzureRMProfileCommand cmdlt = new SaveAzureRMProfileCommand ( ) ;
109
109
// Setup
110
- cmdlt . Profile = profile ;
110
+ cmdlt . Profile = ( PSAzureProfile ) profile ;
111
111
cmdlt . Path = "X:\\ foo.json" ;
112
112
cmdlt . DataStore = _dataStore ;
113
113
cmdlt . SetCommandRuntimeMock ( _commandRuntimeMock ) ;
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ protected override void ProcessRecord()
40
40
{
41
41
if ( Profile != null )
42
42
{
43
- ( ( AzureRMProfile ) Profile ) . Save ( Path ) ;
43
+ ( ( AzureRMProfile ) Profile ) . Save ( DataStore , Path ) ;
44
44
}
45
45
else
46
46
{
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ public class CmdletHelp
33
33
private IList < CmdletHelpReference > _references = new List < CmdletHelpReference > ( ) ;
34
34
private IList < Type > _output = new List < Type > ( ) ;
35
35
private string _noun ;
36
- private string _synopsis = null ;
37
36
public string ClassName { get ; set ; }
38
37
public string AssemblyName { get ; set ; }
39
38
public string NounName
You can’t perform that action at this time.
0 commit comments