[corlib] TimeZoneInfo.AdjustmentRule from reference sources
authorMarek Safar <marek.safar@gmail.com>
Wed, 8 Apr 2015 17:31:29 +0000 (19:31 +0200)
committerMarek Safar <marek.safar@gmail.com>
Wed, 8 Apr 2015 17:31:59 +0000 (19:31 +0200)
external/referencesource
mcs/class/corlib/ReferenceSources/TimeZoneInfoOptions.cs [deleted file]
mcs/class/corlib/System/TimeZoneInfo.AdjustmentRule.cs [deleted file]
mcs/class/corlib/System/TimeZoneInfo.TransitionTime.cs [deleted file]
mcs/class/corlib/System/TimeZoneInfo.cs
mcs/class/corlib/Test/System/TimeZoneInfo.AdjustmentRuleTest.cs
mcs/class/corlib/corlib.dll.sources

index 1ed5f9f2510cfc13a8badd9624316439b16255af..a8bf9ebd8c7d32a6ae0c74f8c379cad26eb38c7e 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 1ed5f9f2510cfc13a8badd9624316439b16255af
+Subproject commit a8bf9ebd8c7d32a6ae0c74f8c379cad26eb38c7e
diff --git a/mcs/class/corlib/ReferenceSources/TimeZoneInfoOptions.cs b/mcs/class/corlib/ReferenceSources/TimeZoneInfoOptions.cs
deleted file mode 100644 (file)
index 50ce810..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace System
-{
-    [Flags]
-    internal enum TimeZoneInfoOptions {
-        None                      = 1,
-        NoThrowOnInvalidTime      = 2
-    };
-}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/TimeZoneInfo.AdjustmentRule.cs b/mcs/class/corlib/System/TimeZoneInfo.AdjustmentRule.cs
deleted file mode 100644 (file)
index 3afac77..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * System.TimeZoneInfo.AdjustmentRule
- *
- * Author(s)
- *     Stephane Delcroix <stephane@delcroix.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-
-namespace System
-{
-       public
-       sealed partial class TimeZoneInfo {
-               [SerializableAttribute]
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-               public sealed class AdjustmentRule : IEquatable<TimeZoneInfo.AdjustmentRule>, ISerializable, IDeserializationCallback
-               {
-                       DateTime dateEnd;
-                       public DateTime DateEnd {
-                               get { return dateEnd; } 
-                       }
-
-                       DateTime dateStart;
-                       public DateTime DateStart {
-                               get { return dateStart; }
-                       }
-
-                       TimeSpan daylightDelta;
-                       public TimeSpan DaylightDelta {
-                               get { return daylightDelta; }
-                       }
-
-                       TransitionTime daylightTransitionEnd;
-                       public TransitionTime DaylightTransitionEnd {
-                               get { return daylightTransitionEnd; }
-                       }
-
-                       TransitionTime daylightTransitionStart;
-                       public TransitionTime DaylightTransitionStart {
-                               get { return daylightTransitionStart; }
-                       }
-
-                       public static AdjustmentRule CreateAdjustmentRule (
-                               DateTime dateStart,
-                               DateTime dateEnd,
-                               TimeSpan daylightDelta,
-                               TransitionTime daylightTransitionStart,
-                               TransitionTime daylightTransitionEnd)
-                       {
-                               return new AdjustmentRule (dateStart, dateEnd, daylightDelta, daylightTransitionStart, daylightTransitionEnd);
-                       }
-
-                       private AdjustmentRule (SerializationInfo info, StreamingContext context)
-                       {
-                               if (info == null)
-                                       throw new ArgumentNullException ("info");
-                               dateStart = (DateTime) info.GetValue ("DateStart", typeof (DateTime));
-                               dateEnd = (DateTime) info.GetValue ("DateEnd", typeof (DateTime));
-                               daylightDelta = (TimeSpan) info.GetValue ("DaylightDelta", typeof (TimeSpan));
-                               daylightTransitionStart = (TimeZoneInfo.TransitionTime) info.GetValue ("DaylightTransitionStart", typeof (TimeZoneInfo.TransitionTime));
-                               daylightTransitionEnd = (TimeZoneInfo.TransitionTime) info.GetValue ("DaylightTransitionEnd", typeof (TimeZoneInfo.TransitionTime));
-                       }
-                       
-                       private AdjustmentRule (
-                               DateTime dateStart,
-                               DateTime dateEnd,
-                               TimeSpan daylightDelta,
-                               TransitionTime daylightTransitionStart,
-                               TransitionTime daylightTransitionEnd)
-                       {
-                               if (dateStart.Kind != DateTimeKind.Unspecified || dateEnd.Kind != DateTimeKind.Unspecified)
-                                       throw new ArgumentException ("the Kind property of dateStart or dateEnd parameter does not equal DateTimeKind.Unspecified");
-
-                               if (daylightTransitionStart == daylightTransitionEnd)
-                                       throw new ArgumentException ("daylightTransitionStart parameter cannot equal daylightTransitionEnd parameter");
-
-                               if (dateStart.Ticks % TimeSpan.TicksPerDay != 0 || dateEnd.Ticks % TimeSpan.TicksPerDay != 0)
-                                       throw new ArgumentException ("dateStart or dateEnd parameter includes a time of day value");
-
-                               if (dateEnd < dateStart)
-                                       throw new ArgumentOutOfRangeException ("dateEnd is earlier than dateStart");
-
-                               if (daylightDelta > new TimeSpan (14, 0, 0) || daylightDelta < new TimeSpan (-14, 0, 0))
-                                       throw new ArgumentOutOfRangeException ("daylightDelta is less than -14 or greater than 14 hours");
-
-                               if (daylightDelta.Ticks % TimeSpan.TicksPerSecond != 0)
-                                       throw new ArgumentOutOfRangeException ("daylightDelta parameter does not represent a whole number of seconds");
-
-                               this.dateStart = dateStart;
-                               this.dateEnd = dateEnd;
-                               this.daylightDelta = daylightDelta;
-                               this.daylightTransitionStart = daylightTransitionStart;
-                               this.daylightTransitionEnd = daylightTransitionEnd;
-                       }
-
-                       public bool Equals (TimeZoneInfo.AdjustmentRule other)
-                       {
-                               return dateStart == other.dateStart &&
-                                       dateEnd == other.dateEnd &&
-                                       daylightDelta == other.daylightDelta && 
-                                       daylightTransitionStart == other.daylightTransitionStart &&
-                                       daylightTransitionEnd == other.daylightTransitionEnd;
-                       }
-
-                       public override int GetHashCode ()
-                       {
-                               return dateStart.GetHashCode () ^ 
-                                       dateEnd.GetHashCode () ^
-                                       daylightDelta.GetHashCode () ^
-                                       daylightTransitionStart.GetHashCode () ^
-                                       daylightTransitionEnd.GetHashCode ();
-                       }
-                                       
-                       void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
-                       {
-                               if (info == null)
-                                       throw new ArgumentNullException ("info");
-                               info.AddValue ("DateStart", DateStart);
-                               info.AddValue ("DateEnd", DateEnd);
-                               info.AddValue ("DaylightDelta", DaylightDelta);
-                               info.AddValue ("DaylightTransitionStart", DaylightTransitionStart);
-                               info.AddValue ("DaylightTransitionEnd", DaylightTransitionEnd);
-                       }
-                       void IDeserializationCallback.OnDeserialization (object sender)
-                       {
-                               try {
-                                       TimeZoneInfo.AdjustmentRule.Validate (dateStart, dateEnd, daylightDelta, 
-                                                                             daylightTransitionStart, daylightTransitionEnd);
-                               } catch (ArgumentException ex) {
-                                       throw new SerializationException ("invalid serialization data", ex);
-                               }
-                       }
-
-                       private static void Validate (
-                               DateTime dateStart,
-                               DateTime dateEnd,
-                               TimeSpan daylightDelta,
-                               TransitionTime daylightTransitionStart,
-                               TransitionTime daylightTransitionEnd)
-                       {
-                               if (dateStart.Kind != DateTimeKind.Unspecified || dateEnd.Kind != DateTimeKind.Unspecified)
-                                       throw new ArgumentException ("the Kind property of dateStart or dateEnd parameter does not equal DateTimeKind.Unspecified");
-
-                               if (daylightTransitionStart == daylightTransitionEnd)
-                                       throw new ArgumentException ("daylightTransitionStart parameter cannot equal daylightTransitionEnd parameter");
-
-                               if (dateStart.Ticks % TimeSpan.TicksPerDay != 0 || dateEnd.Ticks % TimeSpan.TicksPerDay != 0)
-                                       throw new ArgumentException ("dateStart or dateEnd parameter includes a time of day value");
-
-                               if (dateEnd < dateStart)
-                                       throw new ArgumentOutOfRangeException ("dateEnd is earlier than dateStart");
-
-                               if (daylightDelta > new TimeSpan (14, 0, 0) || daylightDelta < new TimeSpan (-14, 0, 0))
-                                       throw new ArgumentOutOfRangeException ("daylightDelta is less than -14 or greater than 14 hours");
-
-                               if (daylightDelta.Ticks % TimeSpan.TicksPerSecond != 0)
-                                       throw new ArgumentOutOfRangeException ("daylightDelta parameter does not represent a whole number of seconds");
-                       }
-               }
-       }
-}
diff --git a/mcs/class/corlib/System/TimeZoneInfo.TransitionTime.cs b/mcs/class/corlib/System/TimeZoneInfo.TransitionTime.cs
deleted file mode 100644 (file)
index 37a7064..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * System.TimeZoneInfo.TransitionTime
- *
- * Author(s)
- *     Stephane Delcroix <stephane@delcroix.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-
-namespace System
-{
-       public
-       sealed partial class TimeZoneInfo
-       {
-               [SerializableAttribute]
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-               public struct TransitionTime : IEquatable<TimeZoneInfo.TransitionTime>, ISerializable, IDeserializationCallback
-               {
-                       DateTime timeOfDay;
-                       public DateTime TimeOfDay {
-                               get { return timeOfDay; }
-                       }
-
-                       int month;
-                       public int Month {
-                               get { return month; }
-                       }
-
-                       int day;
-                       public int Day {
-                               get { 
-#if STRICT
-                                       if (!isFixedDateRule)
-                                               throw new Exception ("Day property is not valid for floating date rules");
-#endif
-                                       return day; 
-                               }
-                       }
-
-                       int week;
-                       public int Week {
-                               get { 
-#if STRICT
-                                       if (isFixedDateRule)
-                                               throw new Exception ("Week property is not valid for fixed date rules");
-#endif
-               
-                                       return week; 
-                               }
-                       }
-
-                       DayOfWeek dayOfWeek;
-                       public DayOfWeek DayOfWeek {
-                               get { 
-#if STRICT
-                                       if (isFixedDateRule)
-                                               throw new Exception ("DayOfWeek property is not valid for fixed date rules");
-#endif
-       
-                                       return dayOfWeek; 
-                               }
-                       }
-
-                       bool isFixedDateRule;
-                       public bool IsFixedDateRule {
-                               get { return isFixedDateRule; }
-                       }
-
-                       public static TransitionTime CreateFixedDateRule (
-                               DateTime timeOfDay, 
-                               int month, 
-                               int day)
-                       {
-                               return new TransitionTime (timeOfDay, month, day);
-                       }
-
-                       public static TransitionTime CreateFloatingDateRule (
-                               DateTime timeOfDay,
-                               int month,
-                               int week,
-                               DayOfWeek dayOfWeek)
-                       {
-                               return new TransitionTime (timeOfDay, month, week, dayOfWeek);
-                       }
-
-                       private TransitionTime (SerializationInfo info, StreamingContext context)
-                       {
-                               if (info == null)
-                                       throw new ArgumentNullException ("info");
-                               timeOfDay = (DateTime) info.GetValue ("TimeOfDay", typeof (DateTime));
-                               month = (byte) info.GetValue ("Month", typeof (byte));
-                               week = (byte) info.GetValue ("Week", typeof (byte));
-                               day = (byte) info.GetValue ("Day", typeof (byte));
-                               dayOfWeek = (DayOfWeek) info.GetValue ("DayOfWeek", typeof (DayOfWeek));
-                               isFixedDateRule = (bool) info.GetValue ("IsFixedDateRule", typeof (bool));
-
-                               if (isFixedDateRule)
-                               {
-                                       week = -1;
-                                       dayOfWeek = (DayOfWeek) (-1);
-                               }
-                               if (!isFixedDateRule)                   
-                                       day = -1;
-                       }
-
-                       private TransitionTime (
-                               DateTime timeOfDay,
-                               int month,
-                               int day) : this (timeOfDay, month)
-                       {
-                               if (day < 1 || day > 31)
-                                       throw new ArgumentOutOfRangeException ("day parameter is less than 1 or greater than 31");
-
-                               this.day = day; 
-                               this.isFixedDateRule = true;
-                       }
-
-                       private TransitionTime (
-                               DateTime timeOfDay,
-                               int month,
-                               int week,
-                               DayOfWeek dayOfWeek)  : this (timeOfDay, month)
-                       {
-                               if (week < 1 || week > 5)
-                                       throw new ArgumentOutOfRangeException ("week parameter is less than 1 or greater than 5");
-
-                               if (dayOfWeek != DayOfWeek.Sunday &&
-                                               dayOfWeek != DayOfWeek.Monday &&
-                                               dayOfWeek != DayOfWeek.Tuesday &&
-                                               dayOfWeek != DayOfWeek.Wednesday &&
-                                               dayOfWeek != DayOfWeek.Thursday &&
-                                               dayOfWeek != DayOfWeek.Friday &&
-                                               dayOfWeek != DayOfWeek.Saturday)
-                                       throw new ArgumentOutOfRangeException ("dayOfWeek parameter is not a member od DayOfWeek enumeration");
-
-                               this.week = week;
-                               this.dayOfWeek = dayOfWeek;
-                               this.isFixedDateRule = false;
-                       }
-
-                       private TransitionTime (
-                               DateTime timeOfDay,
-                               int month)
-                       {
-                               if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1)
-                                       throw new ArgumentException ("timeOfDay parameter has a non-default date component");
-
-                               if (timeOfDay.Kind != DateTimeKind.Unspecified)
-                                       throw new ArgumentException ("timeOfDay parameter Kind's property is not DateTimeKind.Unspecified");
-
-                               if (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0)
-                                       throw new ArgumentException ("timeOfDay parameter does not represent a whole number of milliseconds");
-
-                               if (month < 1 || month > 12)
-                                       throw new ArgumentOutOfRangeException ("month parameter is less than 1 or greater than 12");
-                               
-                               this.timeOfDay = timeOfDay;
-                               this.month = month;
-
-                               this.week = -1;
-                               this.dayOfWeek = (System.DayOfWeek)(-1);
-                               this.day = -1;
-                               this.isFixedDateRule = false;
-                       }
-
-                       public static bool operator == (TransitionTime t1, TransitionTime t2)
-                       {
-                               return ( t1.day == t2.day &&
-                                               t1.dayOfWeek == t2.dayOfWeek &&
-                                               t1.isFixedDateRule == t2.isFixedDateRule &&
-                                               t1.month == t2.month &&
-                                               t1.timeOfDay == t2.timeOfDay &&
-                                               t1.week == t2.week);    
-                       }
-
-                       public static bool operator != (TransitionTime t1, TransitionTime t2)
-                       {
-                               return !(t1 == t2);
-                       }
-
-
-                       void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
-                       {
-                               if (info == null)
-                                       throw new ArgumentNullException ("info");
-                               info.AddValue ("TimeOfDay", TimeOfDay);
-                               info.AddValue ("Month", System.Convert.ToByte(Month));
-                               if (week > -1)
-                                       info.AddValue ("Week", System.Convert.ToByte(week));
-                               else 
-                                       info.AddValue ("Week", (byte) 1);
-                               if (day > -1)
-                                       info.AddValue ("Day", System.Convert.ToByte(day));
-                               else
-                                       info.AddValue ("Day", (byte) 1);
-                               if (dayOfWeek !=  ((System.DayOfWeek) (-1)))
-                                       info.AddValue ("DayOfWeek", dayOfWeek);
-                               else
-                                       info.AddValue ("DayOfWeek", DayOfWeek.Sunday);
-                               info.AddValue ("IsFixedDateRule", IsFixedDateRule);
-                       }       
-       
-                       public override bool Equals (object obj)
-                       {
-                               if (obj is TransitionTime)
-                                       return this == (TransitionTime) obj;
-                               return false;
-                       }
-
-                       public bool Equals (TimeZoneInfo.TransitionTime other)
-                       {
-                               return this == other;
-                       }
-
-                       public override int GetHashCode ()
-                       {
-                               return (day ^ (int)dayOfWeek ^ month ^ (int)timeOfDay.Ticks ^ week);
-                       }
-
-                       void IDeserializationCallback.OnDeserialization (object sender)
-                       {
-                               try {
-                                       TimeZoneInfo.TransitionTime.Validate (timeOfDay, month, week, day, dayOfWeek, isFixedDateRule);
-                               } catch (ArgumentException ex) {
-                                       throw new SerializationException ("invalid serialization data", ex);
-                               }
-                       }
-
-                       private static void Validate (DateTime timeOfDay, int month,int week, int day, DayOfWeek dayOfWeek, bool isFixedDateRule)
-                       {
-                               if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1)
-                                       throw new ArgumentException ("timeOfDay parameter has a non-default date component");
-
-                               if (timeOfDay.Kind != DateTimeKind.Unspecified)
-                                       throw new ArgumentException ("timeOfDay parameter Kind's property is not DateTimeKind.Unspecified");
-
-                               if (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0)
-                                       throw new ArgumentException ("timeOfDay parameter does not represent a whole number of milliseconds");
-
-                               if (day < 1 || day > 31) {
-                                       if (!(!isFixedDateRule && day == -1))
-                                               throw new ArgumentOutOfRangeException ("day parameter is less than 1 or greater than 31");
-                               }
-
-                               if (week < 1 || week > 5) {
-                                       if (!(isFixedDateRule && week == -1))
-                                               throw new ArgumentOutOfRangeException ("week parameter is less than 1 or greater than 5");
-                               }
-
-                               if (month < 1 || month > 12)
-                                       throw new ArgumentOutOfRangeException ("month parameter is less than 1 or greater than 12");
-
-                               if (dayOfWeek != DayOfWeek.Sunday &&
-                                               dayOfWeek != DayOfWeek.Monday &&
-                                               dayOfWeek != DayOfWeek.Tuesday &&
-                                               dayOfWeek != DayOfWeek.Wednesday &&
-                                               dayOfWeek != DayOfWeek.Thursday &&
-                                               dayOfWeek != DayOfWeek.Friday &&
-                                               dayOfWeek != DayOfWeek.Saturday) {
-                                       if (!(isFixedDateRule && dayOfWeek == (DayOfWeek) (-1)))
-                                               throw new ArgumentOutOfRangeException ("dayOfWeek parameter is not a member od DayOfWeek enumeration");
-                               }
-                       }
-               }
-       }
-}
index 3c0b535b43b0575a82dc606a44501ce8b9ffb74d..aa93584c933c92e8461a9929723304005038acf9 100644 (file)
@@ -45,14 +45,7 @@ using Microsoft.Win32;
 
 namespace System
 {
-#if MOBILE
-       [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
-       [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
-       [SerializableAttribute]
-       public
-       sealed partial class TimeZoneInfo : IEquatable<TimeZoneInfo>, ISerializable, IDeserializationCallback
+       partial class TimeZoneInfo
        {
                TimeSpan baseUtcOffset;
                public TimeSpan BaseUtcOffset {
index 940b1290ea323a4c12dc25ef5ff342acb7672a18..62ae67cfc814755576e69e8a862864bc5bc71e36 100644 (file)
@@ -55,16 +55,17 @@ namespace MonoTests.System
                        }
                
                        [Test]
-                       [ExpectedException (typeof (ArgumentOutOfRangeException))]
                        public void EndBeforeStart ()
                        {
-                               if (Environment.OSVersion.Platform != PlatformID.Unix)
-                                       throw new ArgumentOutOfRangeException ();;
                                DateTime dateStart = new DateTime (2007,01,01);
                                DateTime dateEnd = new DateTime (2006,01,01);
                                TimeZoneInfo.TransitionTime daylightTransitionStart = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 03, 11);
                                TimeZoneInfo.TransitionTime daylightTransitionEnd = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 10, 11);
-                               TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (1,0,0), daylightTransitionStart, daylightTransitionEnd);
+                               try {
+                                       TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (1,0,0), daylightTransitionStart, daylightTransitionEnd);
+                                       Assert.Fail ();
+                               } catch (ArgumentException) {
+                               }
                        }
                
                        [Test]
@@ -79,7 +80,6 @@ namespace MonoTests.System
                        }
                
                        [Test]
-                       [ExpectedException (typeof (ArgumentOutOfRangeException))]
                        public void DeltaNotInSeconds ()
                        {
                                if (Environment.OSVersion.Platform != PlatformID.Unix)
@@ -88,7 +88,11 @@ namespace MonoTests.System
                                DateTime dateEnd = new DateTime (2008,01,01);
                                TimeZoneInfo.TransitionTime daylightTransitionStart = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 03, 11);
                                TimeZoneInfo.TransitionTime daylightTransitionEnd = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 10, 11);
-                               TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (55), daylightTransitionStart, daylightTransitionEnd);
+                               try {
+                                       TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (55), daylightTransitionStart, daylightTransitionEnd);
+                                       Assert.Fail ();
+                               } catch (ArgumentException) {
+                               }
                        }
                }
        
index dfc262d7ecc3a487a7398361a4cb80c5413ec583..571c35737889ded572973cb991245c2e3f44dac0 100644 (file)
@@ -149,11 +149,9 @@ System/TermInfoReader.cs
 System/TermInfoStrings.cs
 System/TimeZone.cs
 System/TimeZoneInfo.cs
-System/TimeZoneInfo.AdjustmentRule.cs
 System/TimeZoneInfo.Android.cs
 System/TimeZoneInfo.MonoTouch.cs
 System/TimeZoneInfo.Serialization.cs
-System/TimeZoneInfo.TransitionTime.cs
 ../../build/common/MonoTODOAttribute.cs
 System/TypeSpec.cs
 System/TypeCode.cs
@@ -1120,7 +1118,6 @@ ReferenceSources/Environment.cs
 ReferenceSources/ExecutionContext.cs
 ReferenceSources/HashHelpers.cs
 ReferenceSources/ParseNumbers.cs
-ReferenceSources/TimeZoneInfoOptions.cs
 ReferenceSources/AppDomain.cs
 ReferenceSources/CLRConfig.cs
 ReferenceSources/JitHelpers.cs
@@ -1256,6 +1253,7 @@ ReferenceSources/CompareInfo.cs
 ../../../external/referencesource/mscorlib/system/threadattributes.cs
 ../../../external/referencesource/mscorlib/system/threadstaticattribute.cs
 ../../../external/referencesource/mscorlib/system/throwhelper.cs
+../../../external/referencesource/mscorlib/system/timezoneinfo.cs
 ../../../external/referencesource/mscorlib/system/timezonenotfoundexception.cs
 ../../../external/referencesource/mscorlib/system/tuple.cs
 ../../../external/referencesource/mscorlib/system/type.cs