Skip to content

Commit dee21d9

Browse files
committed
Removed DEBUG code in CS and removed uneccessary mocks
1 parent 8564c86 commit dee21d9

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/SetTimeZone.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff 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");

Tests/Integration/ComputerManagementDsc.Common.Tests.ps1

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ try
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
}
@@ -83,8 +80,6 @@ try
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
}

0 commit comments

Comments
 (0)