Imported Upstream version 6.0.0.310

Former-commit-id: 4920e33be349109f038445814407a4de396c82a8
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-06-28 08:52:31 +00:00
parent 43178b2bf1
commit 9163dc941b
47 changed files with 66 additions and 38 deletions

View File

@@ -72,6 +72,10 @@ namespace MonoTests.System
return "W. Europe Standard Time";
case "Canada/Eastern":
return "Eastern Standard Time";
case "Asia/Tehran":
return "Iran Standard Time";
case "Europe/Guernsey":
return "GMT Standard Time";
default:
Assert.Fail ($"No mapping defined for zone id '{id}'");
return null;
@@ -459,6 +463,24 @@ namespace MonoTests.System
date = new DateTime (2019, 3, 10, 3, 0, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-5, 0, 0), tzi.GetUtcOffset (date));
#if !WINAOT // https://github.com/mono/mono/issues/15439
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("Europe/Vatican"));
date = new DateTime (2018, 10, 28, 2, 15, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (1, 0, 0), tzi.GetUtcOffset (date));
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("Asia/Tehran"));
date = new DateTime (2018, 9, 21, 23, 15, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (3, 30, 0), tzi.GetUtcOffset (date));
// for Greenwitch Mean Time (Guernsey)
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("Europe/Guernsey"));
date = new DateTime (2019, 10, 27, 1, 15, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (0, 0, 0), tzi.GetUtcOffset (date));
#endif
}
}