File tree Expand file tree Collapse file tree
Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -216,13 +216,6 @@ public class TimeZone
216216 public static void Set ( string name )
217217 {
218218 var regTimeZones = Registry . LocalMachine . OpenSubKey ( "SOFTWARE\\ Microsoft\\ Windows NT\\ CurrentVersion\\ Time Zones" ) ;
219- if ( DEBUG ) {
220- // Print out all the possible time-zones.
221- foreach ( var subKey in regTimeZones . GetSubKeyNames ( ) )
222- {
223- Console . WriteLine ( subKey ) ;
224- }
225- }
226219 var subKey = regTimeZones . GetSubKeyNames ( ) . Where ( s => s == name ) . First ( ) ;
227220 string daylightName = ( string ) regTimeZones . OpenSubKey ( subKey ) . GetValue ( "Dlt" ) ;
228221 string standardName = ( string ) regTimeZones . OpenSubKey ( subKey ) . GetValue ( "Std" ) ;
Original file line number Diff line number Diff line change 5858 return ' OK'
5959 }
6060
61- Mock - CommandName Add-Type
62- Mock - CommandName Set-TimeZoneUsingDotNet
63-
6461 It ' Should not throw an exception' {
6562 { Set-TimeZoneId - TimezoneId ' Eastern Standard Time' } | Should -Not - Throw
6663 }
8380 } - Exactly - Times 1
8481
8582 Assert-MockCalled - CommandName TzUtil.exe - Exactly - Times 0
86- Assert-MockCalled - CommandName Add-Type - Exactly - Times 0
87- Assert-MockCalled - CommandName Set-TimeZoneUsingDotNet - Exactly - Times 1
8883 }
8984 }
9085 }
You can’t perform that action at this time.
0 commit comments