Imported Upstream version 6.8.0.73

Former-commit-id: d18deab1b47cfd3ad8cba82b3f37d00eec2170af
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-12-10 18:00:56 +00:00
parent bceda29824
commit 73ee7591e8
1043 changed files with 16271 additions and 22080 deletions

View File

@ -56,12 +56,12 @@ namespace MonoTests.System
return "GTB Standard Time";
case "Europe/Chisinau":
return "E. Europe Standard Time";
case "US/Eastern":
case "America/New_York":
return "Eastern Standard Time";
case "America/Chicago":
case "US/Central":
return "Central Standard Time";
case "US/Pacific":
case "America/Los_Angeles":
return "Pacific Standard Time";
case "Australia/Sydney":
case "Australia/Melbourne":
@ -84,7 +84,7 @@ namespace MonoTests.System
case "Europe/Oslo":
case "Europe/San_Marino":
return "W. Europe Standard Time";
case "Canada/Eastern":
case "America/Toronto":
return "Eastern Standard Time";
case "Asia/Tehran":
return "Iran Standard Time";
@ -482,26 +482,38 @@ namespace MonoTests.System
Assert.IsTrue (tzi.IsDaylightSavingTime (dateOffset));
}
// https://github.com/mono/mono/issues/16742
[Test]
public void Bug_16472 ()
{
var parsedTime = DateTime.Parse ("1948-02-19T23:00:00Z", CultureInfo.InvariantCulture);
var newTime = TimeZoneInfo.ConvertTime (parsedTime, TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("Europe/Rome")));
Assert.AreEqual (1948, newTime.Year);
}
// https://github.com/mono/mono/issues/9664
[Test]
public void Bug_9664 ()
{
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
TimeZoneInfo tzi;
try {
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
} catch (TimeZoneNotFoundException e) {
Assert.Ignore ("Timezone US/Central not found.");
return;
}
var date = new DateTime (2019, 3, 9, 21, 0, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date));
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
date = new DateTime (2019, 3, 10, 2, 0, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date));
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
date = new DateTime (2019, 3, 10, 2, 30, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date));
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
date = new DateTime (2019, 3, 10, 3, 0, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-5, 0, 0), tzi.GetUtcOffset (date));
@ -533,207 +545,207 @@ namespace MonoTests.System
new DateTime (2020, 3, 8, 0, 0, 0), new DateTime (2020, 3, 8, 0, 30, 0), new DateTime (2020, 3, 8, 1, 0, 0),
new TimeSpan (-5, 0, 0), new TimeSpan (-4, 0, 0));
// US, Kansas City, MO (US Central Time): Jumps ahead at 2:00 AM on 3/8/2020 to 3:00 AM
// US, Kansas City, MO (US Central Time): Jumps ahead at 2:00 AM on 3/8/2020 to 3:00 AM
CheckJumpingIntoDST ("America/Chicago",
new DateTime (2020, 3, 8, 2, 0, 0), new DateTime (2020, 3, 8, 2, 30, 0), new DateTime (2020, 3, 8, 3, 0, 0),
new TimeSpan (-6, 0, 0), new TimeSpan (-5, 0, 0));
// Anchorage, AK (Alaska Time): Jumps ahead at 2:00 AM on 3/8/2020 to 3:00 AM
// Anchorage, AK (Alaska Time): Jumps ahead at 2:00 AM on 3/8/2020 to 3:00 AM
CheckJumpingIntoDST ("America/Anchorage",
new DateTime (2020, 3, 8, 2, 0, 0), new DateTime (2020, 3, 8, 2, 30, 0), new DateTime (2020, 3, 8, 3, 0, 0),
new TimeSpan (-9, 0, 0), new TimeSpan (-8, 0, 0));
// Azores ST (Ponta Delgada, Portugal): Jumps ahead at 12:00 AM on 3/29/2020 to 1:00 AM
// Azores ST (Ponta Delgada, Portugal): Jumps ahead at 12:00 AM on 3/29/2020 to 1:00 AM
CheckJumpingIntoDST ("Atlantic/Azores",
new DateTime (2020, 3, 29, 0, 0, 0), new DateTime (2020, 3, 29, 0, 30, 0), new DateTime (2020, 3, 29, 1, 0, 0),
new TimeSpan (-1, 0, 0), new TimeSpan (0, 0, 0));
// Iran, Tehran (Iran ST): Jumps ahead at 12:00 AM on 3/21/2020 to 1:00 AM
// Iran, Tehran (Iran ST): Jumps ahead at 12:00 AM on 3/21/2020 to 1:00 AM
CheckJumpingIntoDST ("Asia/Tehran",
new DateTime (2020, 3, 21, 0, 0, 0), new DateTime (2020, 3, 21, 0, 30, 0), new DateTime (2020, 3, 21, 1, 0, 0),
new TimeSpan (3, 30, 0), new TimeSpan (4, 30, 0));
// Israel, Jerusalem (Israel ST): Jumps ahead at 2:00 AM on 3/27/2020 to 3:00 AM
// Israel, Jerusalem (Israel ST): Jumps ahead at 2:00 AM on 3/27/2020 to 3:00 AM
CheckJumpingIntoDST ("Asia/Jerusalem",
new DateTime (2020, 3, 27, 2, 0, 0), new DateTime (2020, 3, 27, 2, 30, 0), new DateTime (2020, 3, 27, 3, 0, 0),
new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0));
// Jordan, Amman (Eastern European ST): Jumps ahead at 12:00 AM on 3/27/2020 to 1:00 AM
// Jordan, Amman (Eastern European ST): Jumps ahead at 12:00 AM on 3/27/2020 to 1:00 AM
CheckJumpingIntoDST ("Asia/Amman",
new DateTime (2020, 3, 27, 0, 0, 0), new DateTime (2020, 3, 27, 0, 30, 0), new DateTime (2020, 3, 27, 1, 0, 0),
new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0));
// Albania, Tirana (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Albania, Tirana (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Tirane",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Austria, Vienna (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Austria, Vienna (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Vienna",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Belgium, Brussels (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Belgium, Brussels (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Brussels",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Bulgaria, Sofia (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
// Bulgaria, Sofia (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
CheckJumpingIntoDST ("Europe/Sofia",
new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0),
new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0));
// Czechia, Prague (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Czechia, Prague (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Prague",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Denmark, Copenhagen (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Denmark, Copenhagen (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Copenhagen",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Estonia, Tallinn (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
// Estonia, Tallinn (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
CheckJumpingIntoDST ("Europe/Tallinn",
new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0),
new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0));
// France, Paris (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// France, Paris (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Paris",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Germany, Berlin (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Germany, Berlin (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Berlin",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Greece, Athens (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
// Greece, Athens (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
CheckJumpingIntoDST ("Europe/Athens",
new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0),
new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0));
// Guernsey (UK) Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
// Guernsey (UK) Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
CheckJumpingIntoDST ("Europe/Guernsey",
new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0),
new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0));
// Holy See, Vatican City (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Holy See, Vatican City (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Vatican",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Hungary, Budapest (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Hungary, Budapest (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Budapest",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// // Ireland, Dublin (Greenwich Mean Time -> Irish Standard Time): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
// // Ireland, Dublin (Greenwich Mean Time -> Irish Standard Time): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
// CheckJumpingIntoDST ("Europe/Dublin",
// new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0),
// new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0));
// UK, Douglas, Isle of Man (GMT+1:00): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
// UK, Douglas, Isle of Man (GMT+1:00): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
CheckJumpingIntoDST ("Europe/Isle_of_Man",
new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0),
new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0));
// Italy, Rome (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Italy, Rome (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Rome",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Jersey (UK): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
// Jersey (UK): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
CheckJumpingIntoDST ("Europe/Jersey",
new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0),
new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0));
// Latvia, Riga (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
// Latvia, Riga (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
CheckJumpingIntoDST ("Europe/Riga",
new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0),
new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0));
// Lithuania, Vilnius (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
// Lithuania, Vilnius (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
CheckJumpingIntoDST ("Europe/Vilnius",
new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0),
new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0));
// Luxembourg, Luxembourg (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Luxembourg, Luxembourg (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Luxembourg",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Malta, Valletta (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Malta, Valletta (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Malta",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Moldova, Chişinău (Eastern European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Moldova, Chişinău (Eastern European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Chisinau",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0));
// Monaco, Monaco (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Monaco, Monaco (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Monaco",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Netherlands, Amsterdam (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Netherlands, Amsterdam (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Amsterdam",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Norway, Oslo (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Norway, Oslo (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Oslo",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Poland, Warsaw (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Poland, Warsaw (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Warsaw",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Portugal, Lisbon (Western European ST): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
// Portugal, Lisbon (Western European ST): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
CheckJumpingIntoDST ("Europe/Lisbon",
new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0),
new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0));
// San Marino, San Marino (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// San Marino, San Marino (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/San_Marino",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Slovakia, Bratislava (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Slovakia, Bratislava (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Bratislava",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Spain, Madrid (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
// Spain, Madrid (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM
CheckJumpingIntoDST ("Europe/Madrid",
new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0),
new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0));
// Ukraine, Kiev (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
// Ukraine, Kiev (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM
CheckJumpingIntoDST ("Europe/Kiev",
new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0),
new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0));
// United Kingdom, London (British ST): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
// United Kingdom, London (British ST): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM
CheckJumpingIntoDST ("Europe/London",
new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0),
new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0));
}
void CheckJumpingIntoDST (string tzId, DateTime dstDeltaStart, DateTime inDstDelta, DateTime dstDeltaEnd, TimeSpan baseOffset, TimeSpan dstOffset)
void CheckJumpingIntoDST (string tzId, DateTime dstDeltaStart, DateTime inDstDelta, DateTime dstDeltaEnd, TimeSpan baseOffset, TimeSpan dstOffset)
{
var tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId (tzId));
Assert.IsFalse (tzi.IsDaylightSavingTime (dstDeltaStart), $"{tzId}: #1");
Assert.AreEqual (baseOffset, tzi.GetUtcOffset (dstDeltaStart), $"{tzId}: #2");
Assert.IsFalse (tzi.IsDaylightSavingTime (inDstDelta), $"{tzId}: #3");
Assert.IsFalse (tzi.IsDaylightSavingTime (inDstDelta), $"{tzId}: #3");
Assert.AreEqual (baseOffset, tzi.GetUtcOffset (inDstDelta), $"{tzId}: #4");
Assert.IsTrue (tzi.IsDaylightSavingTime (dstDeltaEnd), $"{tzId}: #5");
Assert.IsTrue (tzi.IsDaylightSavingTime (dstDeltaEnd), $"{tzId}: #5");
Assert.AreEqual (dstOffset, tzi.GetUtcOffset (dstDeltaEnd), $"{tzId}: #6");
}
}
@ -998,8 +1010,8 @@ namespace MonoTests.System
[Test (Description="Fix the bug https://bugzilla.xamarin.com/show_bug.cgi?id=1849")]
public void ConvertTime_AjustmentConvertTimeWithSourceTimeZone () {
TimeZoneInfo easternTimeZone = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Eastern"));
TimeZoneInfo pacificTimeZone = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Pacific"));
TimeZoneInfo easternTimeZone = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("America/New_York"));
TimeZoneInfo pacificTimeZone = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("America/Los_Angeles"));
DateTime lastMidnight = new DateTime (new DateTime (2012, 06, 13).Ticks, DateTimeKind.Unspecified);
DateTime lastMidnightAsEST = TimeZoneInfo.ConvertTime (lastMidnight, pacificTimeZone, easternTimeZone);
@ -1276,7 +1288,6 @@ namespace MonoTests.System
"Europe/Dublin", // Europe/Dublin has a DST offset of 34 minutes and 39 seconds in 1916.
"Europe/Amsterdam",
"America/St_Johns",
"Canada/Newfoundland",
"Europe/Moscow",
"Europe/Riga",
};