}
[Test]
- [Category ("TargetJvmNotWorking")]
public void CurrentTimeZone_SerializationRoundtrip ()
{
TimeZone tz = TimeZone.CurrentTimeZone;
DateTime dst_start_utc = tz.GetDaylightChanges(2007).Start.ToUniversalTime ();
if (dst_start_utc == DateTime.MinValue)
- return;
+ Assert.Ignore ("Couldn't get beginning of daylight saving time in 2007.");
Assert.IsTrue (tz.ToLocalTime (dst_start_utc.Subtract (new TimeSpan (0, 1, 0))) < tz.ToLocalTime (dst_start_utc), "0:1:59 < 0:3:00");
Assert.IsTrue (tz.ToLocalTime (dst_start_utc) < tz.ToLocalTime (dst_start_utc.Add (new TimeSpan (0, 1, 0))), "0:3:00 < 0:3:01");
Assert.IsTrue (tz.ToLocalTime (dst_start_utc.Add (new TimeSpan (0, 1, 0))) < tz.ToLocalTime (dst_start_utc.Add (new TimeSpan (0, 59, 0))), "0:3:01 < 0:3:59");
TimeZone tz = TimeZone.CurrentTimeZone;
- DaylightTime daylightChanges = tz.GetDaylightChanges(2007);
+ int year = DateTime.Now.Year;
+ DaylightTime daylightChanges = tz.GetDaylightChanges(year);
DateTime dst_end = daylightChanges.End;
if (dst_end == DateTime.MinValue)
- Assert.Ignore (tz.StandardName + " did not observe daylight saving time during 2007.");
+ Assert.Ignore (tz.StandardName + " did not observe daylight saving time during " + year + ".");
var standardOffset = tz.GetUtcOffset(daylightChanges.Start.AddMinutes(-1));
// now it fails on Snow Leopard the same way (incomplete data) with iOS5 simulator (OS update ?)
// but it *never*ever* failed on devices
incomplete_data_on_simulator_only_bug = true;
+#if XAMCORE_2_0
+ if (ObjCRuntime.Runtime.Arch == ObjCRuntime.Arch.SIMULATOR)
+#else
if (MonoTouch.ObjCRuntime.Runtime.Arch == MonoTouch.ObjCRuntime.Arch.SIMULATOR)
+#endif
Assert.Ignore ("known to fail on some iOS simulator versions - see source comments");
}
}