@@ -39,26 +39,26 @@ public class Scenario
3939
4040 private static readonly DotNetFileSystem _fileSystem = new DotNetFileSystem ( ) ;
4141
42- public static string get_top_level ( )
42+ public static string GetTopLevel ( )
4343 {
4444 return _fileSystem . GetDirectoryName ( _fileSystem . GetCurrentAssemblyPath ( ) ) ;
4545 }
4646
47- public static string get_package_install_path ( )
47+ public static string GetPackageInstallPath ( )
4848 {
49- return _fileSystem . CombinePaths ( get_top_level ( ) , "lib" ) ;
49+ return _fileSystem . CombinePaths ( GetTopLevel ( ) , "lib" ) ;
5050 }
5151
52- public static IEnumerable < string > get_installed_package_paths ( )
52+ public static IEnumerable < string > GetInstalledPackagePaths ( )
5353 {
54- return _fileSystem . GetFiles ( get_package_install_path ( ) , "*" + NuGetConstants . PackageExtension , SearchOption . AllDirectories ) ;
54+ return _fileSystem . GetFiles ( GetPackageInstallPath ( ) , "*" + NuGetConstants . PackageExtension , SearchOption . AllDirectories ) ;
5555 }
5656
57- public static void reset ( ChocolateyConfiguration config )
57+ public static void Reset ( ChocolateyConfiguration config )
5858 {
59- string packagesInstallPath = get_package_install_path ( ) ;
60- string badPackagesPath = get_package_install_path ( ) + "-bad" ;
61- string backupPackagesPath = get_package_install_path ( ) + "-bkp" ;
59+ string packagesInstallPath = GetPackageInstallPath ( ) ;
60+ string badPackagesPath = GetPackageInstallPath ( ) + "-bad" ;
61+ string backupPackagesPath = GetPackageInstallPath ( ) + "-bkp" ;
6262 string shimsPath = ApplicationParameters . ShimsLocation ;
6363 string hooksPath = ApplicationParameters . HooksLocation ;
6464
@@ -68,8 +68,8 @@ public static void reset(ChocolateyConfiguration config)
6868 _fileSystem . DeleteDirectoryChecked ( shimsPath , recursive : true , overrideAttributes : true ) ;
6969 _fileSystem . DeleteDirectoryChecked ( badPackagesPath , recursive : true , overrideAttributes : true ) ;
7070 _fileSystem . DeleteDirectoryChecked ( backupPackagesPath , recursive : true , overrideAttributes : true ) ;
71- _fileSystem . DeleteDirectoryChecked ( _fileSystem . CombinePaths ( get_top_level ( ) , ".chocolatey" ) , recursive : true , overrideAttributes : true ) ;
72- _fileSystem . DeleteDirectoryChecked ( _fileSystem . CombinePaths ( get_top_level ( ) , "extensions" ) , recursive : true , overrideAttributes : true ) ;
71+ _fileSystem . DeleteDirectoryChecked ( _fileSystem . CombinePaths ( GetTopLevel ( ) , ".chocolatey" ) , recursive : true , overrideAttributes : true ) ;
72+ _fileSystem . DeleteDirectoryChecked ( _fileSystem . CombinePaths ( GetTopLevel ( ) , "extensions" ) , recursive : true , overrideAttributes : true ) ;
7373 _fileSystem . DeleteDirectoryChecked ( hooksPath , recursive : true , overrideAttributes : true ) ;
7474
7575 _fileSystem . CreateDirectory ( config . CacheLocation ) ;
@@ -78,16 +78,16 @@ public static void reset(ChocolateyConfiguration config)
7878 _fileSystem . CreateDirectory ( shimsPath ) ;
7979 _fileSystem . CreateDirectory ( badPackagesPath ) ;
8080 _fileSystem . CreateDirectory ( backupPackagesPath ) ;
81- _fileSystem . CreateDirectory ( _fileSystem . CombinePaths ( get_top_level ( ) , ".chocolatey" ) ) ;
82- _fileSystem . CreateDirectory ( _fileSystem . CombinePaths ( get_top_level ( ) , "extensions" ) ) ;
81+ _fileSystem . CreateDirectory ( _fileSystem . CombinePaths ( GetTopLevel ( ) , ".chocolatey" ) ) ;
82+ _fileSystem . CreateDirectory ( _fileSystem . CombinePaths ( GetTopLevel ( ) , "extensions" ) ) ;
8383
8484 PowershellExecutor . AllowUseWindow = false ;
8585 }
8686
87- public static void add_packages_to_source_location ( ChocolateyConfiguration config , string pattern )
87+ public static void AddPackagesToSourceLocation ( ChocolateyConfiguration config , string pattern )
8888 {
8989 _fileSystem . EnsureDirectoryExists ( config . Sources ) ;
90- var contextDir = _fileSystem . CombinePaths ( get_top_level ( ) , "context" ) ;
90+ var contextDir = _fileSystem . CombinePaths ( GetTopLevel ( ) , "context" ) ;
9191 var files = _fileSystem . GetFiles ( contextDir , pattern , SearchOption . AllDirectories ) ;
9292
9393 foreach ( var file in files . OrEmpty ( ) )
@@ -96,11 +96,11 @@ public static void add_packages_to_source_location(ChocolateyConfiguration confi
9696 }
9797 }
9898
99- public static void add_machine_source ( ChocolateyConfiguration config , string name , string path = null , int priority = 0 , bool createDirectory = true )
99+ public static void AddMachineSource ( ChocolateyConfiguration config , string name , string path = null , int priority = 0 , bool createDirectory = true )
100100 {
101101 if ( string . IsNullOrEmpty ( path ) )
102102 {
103- path = _fileSystem . CombinePaths ( get_top_level ( ) , "PrioritySources" , name ) ;
103+ path = _fileSystem . CombinePaths ( GetTopLevel ( ) , "PrioritySources" , name ) ;
104104 }
105105
106106 if ( createDirectory )
@@ -117,14 +117,14 @@ public static void add_machine_source(ChocolateyConfiguration config, string nam
117117 config . MachineSources . Add ( newSource ) ;
118118 }
119119
120- public static string add_packages_to_priority_source_location ( ChocolateyConfiguration config , string pattern , int priority = 0 , string name = null )
120+ public static string AddPackagesToPrioritySourceLocation ( ChocolateyConfiguration config , string pattern , int priority = 0 , string name = null )
121121 {
122122 if ( name == null )
123123 {
124124 name = "Priority" + priority ;
125125 }
126126
127- var prioritySourceDirectory = _fileSystem . CombinePaths ( get_top_level ( ) , "PrioritySources" , name ) ;
127+ var prioritySourceDirectory = _fileSystem . CombinePaths ( GetTopLevel ( ) , "PrioritySources" , name ) ;
128128
129129 var machineSource = config . MachineSources . FirstOrDefault ( m => m . Name . IsEqualTo ( name ) ) ;
130130
@@ -145,7 +145,7 @@ public static string add_packages_to_priority_source_location(ChocolateyConfigur
145145
146146 _fileSystem . EnsureDirectoryExists ( prioritySourceDirectory ) ;
147147
148- var contextDir = _fileSystem . CombinePaths ( get_top_level ( ) , "context" ) ;
148+ var contextDir = _fileSystem . CombinePaths ( GetTopLevel ( ) , "context" ) ;
149149 var files = _fileSystem . GetFiles ( contextDir , pattern , SearchOption . AllDirectories ) . OrEmpty ( ) . ToList ( ) ;
150150
151151 if ( files . Count == 0 )
@@ -161,7 +161,7 @@ public static string add_packages_to_priority_source_location(ChocolateyConfigur
161161 return machineSource . Name ;
162162 }
163163
164- public static void remove_packages_from_destination_location ( ChocolateyConfiguration config , string pattern )
164+ public static void RemovePackagesFromDestinationLocation ( ChocolateyConfiguration config , string pattern )
165165 {
166166 if ( ! _fileSystem . DirectoryExists ( config . Sources ) )
167167 {
@@ -176,7 +176,7 @@ public static void remove_packages_from_destination_location(ChocolateyConfigura
176176 }
177177 }
178178
179- public static void install_package ( ChocolateyConfiguration config , string packageId , string version )
179+ public static void InstallPackage ( ChocolateyConfiguration config , string packageId , string version )
180180 {
181181 if ( _service == null )
182182 {
@@ -192,7 +192,7 @@ public static void install_package(ChocolateyConfiguration config, string packag
192192 NUnitSetup . MockLogger . Messages . Clear ( ) ;
193193 }
194194
195- public static void add_files ( IEnumerable < Tuple < string , string > > files )
195+ public static void AddFiles ( IEnumerable < Tuple < string , string > > files )
196196 {
197197 foreach ( var file in files )
198198 {
@@ -204,26 +204,26 @@ public static void add_files(IEnumerable<Tuple<string, string>> files)
204204 }
205205 }
206206
207- public static void create_directory ( string directoryPath )
207+ public static void CreateDirectory ( string directoryPath )
208208 {
209209 _fileSystem . CreateDirectory ( directoryPath ) ;
210210 }
211211
212- public static void add_changed_version_package_to_source_location ( ChocolateyConfiguration config , string pattern , string newVersion )
212+ public static void AddChangedVersionPackageToSourceLocation ( ChocolateyConfiguration config , string pattern , string newVersion )
213213 {
214214 _fileSystem . EnsureDirectoryExists ( config . Sources ) ;
215- var contextDir = _fileSystem . CombinePaths ( get_top_level ( ) , "context" ) ;
215+ var contextDir = _fileSystem . CombinePaths ( GetTopLevel ( ) , "context" ) ;
216216 var files = _fileSystem . GetFiles ( contextDir , pattern , SearchOption . AllDirectories ) ;
217217
218218 foreach ( var file in files . OrEmpty ( ) )
219219 {
220220 var copyToPath = _fileSystem . CombinePaths ( config . Sources , _fileSystem . GetFileName ( file ) ) ;
221221 _fileSystem . CopyFile ( _fileSystem . GetFullPath ( file ) , copyToPath , overwriteExisting : true ) ;
222- change_package_version ( copyToPath , newVersion ) ;
222+ ChangePackageVersion ( copyToPath , newVersion ) ;
223223 }
224224 }
225225
226- public static void change_package_version ( string existingPackagePath , string newVersion )
226+ public static void ChangePackageVersion ( string existingPackagePath , string newVersion )
227227 {
228228 string packageId ;
229229 XDocument nuspecXml ;
@@ -256,9 +256,9 @@ public static void change_package_version(string existingPackagePath, string new
256256 _fileSystem . MoveFile ( existingPackagePath , renamedPath ) ;
257257 }
258258
259- private static ChocolateyConfiguration baseline_configuration ( )
259+ private static ChocolateyConfiguration BaselineConfiguration ( )
260260 {
261- delete_test_package_directories ( ) ;
261+ DeleteTestPackageDirectories ( ) ;
262262
263263 // note that this does not mean an empty configuration. It does get influenced by
264264 // prior commands, so ensure that all items go back to the default values here
@@ -279,7 +279,7 @@ private static ChocolateyConfiguration baseline_configuration()
279279 config . Information . IsLicensedVersion = false ;
280280 config . AcceptLicense = true ;
281281 config . AllowUnofficialBuild = true ;
282- config . CacheLocation = _fileSystem . GetFullPath ( _fileSystem . CombinePaths ( get_top_level ( ) , "cache" ) ) ;
282+ config . CacheLocation = _fileSystem . GetFullPath ( _fileSystem . CombinePaths ( GetTopLevel ( ) , "cache" ) ) ;
283283 config . CommandExecutionTimeoutSeconds = 2700 ;
284284 config . Force = false ;
285285 config . ForceDependencies = false ;
@@ -297,7 +297,7 @@ private static ChocolateyConfiguration baseline_configuration()
297297 config . PromptForConfirmation = false ;
298298 config . RegularOutput = true ;
299299 config . SkipPackageInstallProvider = false ;
300- config . Sources = _fileSystem . GetFullPath ( _fileSystem . CombinePaths ( get_top_level ( ) , "packages" ) ) ;
300+ config . Sources = _fileSystem . GetFullPath ( _fileSystem . CombinePaths ( GetTopLevel ( ) , "packages" ) ) ;
301301 config . Version = null ;
302302 config . Debug = true ;
303303 config . AllVersions = false ;
@@ -326,90 +326,90 @@ private static ChocolateyConfiguration baseline_configuration()
326326 return config ;
327327 }
328328
329- public static ChocolateyConfiguration install ( )
329+ public static ChocolateyConfiguration Install ( )
330330 {
331- var config = baseline_configuration ( ) ;
331+ var config = BaselineConfiguration ( ) ;
332332 config . CommandName = CommandNameType . Install . ToStringSafe ( ) ;
333333
334334 return config ;
335335 }
336336
337- public static ChocolateyConfiguration upgrade ( )
337+ public static ChocolateyConfiguration Upgrade ( )
338338 {
339- var config = baseline_configuration ( ) ;
339+ var config = BaselineConfiguration ( ) ;
340340 config . CommandName = CommandNameType . Upgrade . ToStringSafe ( ) ;
341341
342342 return config ;
343343 }
344344
345- public static ChocolateyConfiguration uninstall ( )
345+ public static ChocolateyConfiguration Uninstall ( )
346346 {
347- var config = baseline_configuration ( ) ;
347+ var config = BaselineConfiguration ( ) ;
348348 config . CommandName = CommandNameType . Uninstall . ToStringSafe ( ) ;
349349
350350 return config ;
351351 }
352352
353- public static ChocolateyConfiguration list ( )
353+ public static ChocolateyConfiguration List ( )
354354 {
355- var config = baseline_configuration ( ) ;
355+ var config = BaselineConfiguration ( ) ;
356356 config . CommandName = "list" ;
357357
358358 return config ;
359359 }
360360
361- public static ChocolateyConfiguration search ( )
361+ public static ChocolateyConfiguration Search ( )
362362 {
363- var config = baseline_configuration ( ) ;
363+ var config = BaselineConfiguration ( ) ;
364364 config . CommandName = "search" ;
365365
366366 return config ;
367367 }
368368
369- public static ChocolateyConfiguration info ( )
369+ public static ChocolateyConfiguration Info ( )
370370 {
371- var config = baseline_configuration ( ) ;
371+ var config = BaselineConfiguration ( ) ;
372372 config . CommandName = "info" ;
373373 config . Verbose = true ;
374374 config . ListCommand . Exact = true ;
375375
376376 return config ;
377377 }
378378
379- public static ChocolateyConfiguration pin ( )
379+ public static ChocolateyConfiguration Pin ( )
380380 {
381- var config = baseline_configuration ( ) ;
381+ var config = BaselineConfiguration ( ) ;
382382 config . CommandName = "pin" ;
383383
384384 return config ;
385385 }
386386
387- public static ChocolateyConfiguration pack ( )
387+ public static ChocolateyConfiguration Pack ( )
388388 {
389- var config = baseline_configuration ( ) ;
389+ var config = BaselineConfiguration ( ) ;
390390 config . CommandName = "pack" ;
391391
392392 return config ;
393393 }
394394
395- public static ChocolateyConfiguration proxy ( )
395+ public static ChocolateyConfiguration Proxy ( )
396396 {
397- return baseline_configuration ( ) ;
397+ return BaselineConfiguration ( ) ;
398398 }
399399
400- public static void set_configuration_file_setting ( string name , string value )
400+ public static void SetConfigurationFileSetting ( string name , string value )
401401 {
402- var config = baseline_configuration ( ) ;
402+ var config = BaselineConfiguration ( ) ;
403403 config . ConfigCommand . Name = name ;
404404 config . ConfigCommand . ConfigValue = value ;
405405 config . ConfigCommand . Command = ConfigCommandType . Set ;
406406 var configService = NUnitSetup . Container . GetInstance < IChocolateyConfigSettingsService > ( ) ;
407407 configService . SetConfig ( config ) ;
408408 }
409409
410- private static void delete_test_package_directories ( )
410+ private static void DeleteTestPackageDirectories ( )
411411 {
412- var topDirectory = get_top_level ( ) ;
412+ var topDirectory = GetTopLevel ( ) ;
413413
414414 var directoriesToClean = new [ ]
415415 {
0 commit comments