Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ebd9c62

Browse files
committed
Fix invalid test: TimeZoneInfo.Local can be UTC
It's common to have the local time zone set to UTC in server/cloud/CI environments. Also changed Assert.NotEqual(x, null) -> Assert.NotNull(x);
1 parent 196c836 commit ebd9c62

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/System.Runtime/tests/System/TimeZoneInfo.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,14 @@ public static void TestNames()
4141
{
4242
TimeZoneInfo local = TimeZoneInfo.Local;
4343
TimeZoneInfo utc = TimeZoneInfo.Utc;
44-
Assert.NotEqual(local.DaylightName, utc.DaylightName);
45-
Assert.NotEqual(local.DisplayName, utc.DisplayName);
46-
Assert.NotEqual(local.StandardName, utc.StandardName);
4744

48-
Assert.NotEqual(local.DaylightName, null);
49-
Assert.NotEqual(local.DisplayName, null);
50-
Assert.NotEqual(local.StandardName, null);
45+
Assert.NotNull(local.DaylightName);
46+
Assert.NotNull(local.DisplayName);
47+
Assert.NotNull(local.StandardName);
5148

52-
Assert.NotEqual(utc.DaylightName, null);
53-
Assert.NotEqual(utc.DisplayName, null);
54-
Assert.NotEqual(utc.StandardName, null);
49+
Assert.NotNull(utc.DaylightName);
50+
Assert.NotNull(utc.DisplayName);
51+
Assert.NotNull(utc.StandardName);
5552
}
5653

5754
[Fact]

0 commit comments

Comments
 (0)