diff options
author | Hugh Bellamy <hughbellars@gmail.com> | 2017-06-23 22:33:47 +0300 |
---|---|---|
committer | Dan Moseley <danmose@microsoft.com> | 2017-06-23 22:33:47 +0300 |
commit | 59915687bb261efeae70565d0ca8990ac45ceb9c (patch) | |
tree | 383131ec60df92b19c95d7103c1eb7e1bf577426 /src/System.Globalization.Calendars | |
parent | 876acca296364f025a1920ecbe23bd0e5b547932 (diff) |
Convert most Assert.Throws<ArgumentException> without param name to AssertExtensions (#21455)
* Registry
* Collections
* ComponentModel
* Configuration
* Data
* Globalization
* Drawing
* Diagnostics
* IO
* Linq
* Add System.Net param names in tests
* Move ArgumentExceptions in System.Private.Xml to AssertExtensions
* Add System.Reflection.* ArgumentException param names
* Add param names for System.Runtime* ArgumentExceptions
* Add ArgumentException param names to System.Security.*
* Add ArgumentException param names to System.Text.*
* Add param names to ArgumentExceptions in misc projects
* Add System.Threading.* ArgumentException param names
* Fix missing files
* Fixes for unix and netfx
* Fix more failures and revert a IdnaConformance tests to avoid merge conflicts with #21463
Diffstat (limited to 'src/System.Globalization.Calendars')
-rw-r--r-- | src/System.Globalization.Calendars/tests/CalendarHelpers.cs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/System.Globalization.Calendars/tests/CalendarHelpers.cs b/src/System.Globalization.Calendars/tests/CalendarHelpers.cs index f99549039f..3551a4ad03 100644 --- a/src/System.Globalization.Calendars/tests/CalendarHelpers.cs +++ b/src/System.Globalization.Calendars/tests/CalendarHelpers.cs @@ -262,46 +262,46 @@ namespace System.Globalization.Tests [MemberData(nameof(Calendars_TestData))] public static void AddDays_Invalid(Calendar calendar) { - Assert.Throws<ArgumentException>(() => calendar.AddDays(calendar.MaxSupportedDateTime, 1)); - Assert.Throws<ArgumentException>(() => calendar.AddDays(calendar.MinSupportedDateTime, -1)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddDays(calendar.MaxSupportedDateTime, 1)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddDays(calendar.MinSupportedDateTime, -1)); - Assert.Throws<ArgumentException>(() => calendar.AddDays(DateTime.Now, -120001 * 30)); - Assert.Throws<ArgumentException>(() => calendar.AddDays(DateTime.Now, 120001 * 30)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddDays(DateTime.Now, -120001 * 30)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddDays(DateTime.Now, 120001 * 30)); } [Theory] [MemberData(nameof(Calendars_TestData))] public static void AddHours_Invalid(Calendar calendar) { - Assert.Throws<ArgumentException>(() => calendar.AddHours(calendar.MaxSupportedDateTime, 1)); - Assert.Throws<ArgumentException>(() => calendar.AddHours(calendar.MinSupportedDateTime, -1)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddHours(calendar.MaxSupportedDateTime, 1)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddHours(calendar.MinSupportedDateTime, -1)); - Assert.Throws<ArgumentException>(() => calendar.AddHours(DateTime.Now, -120001 * 30 * 24)); - Assert.Throws<ArgumentException>(() => calendar.AddHours(DateTime.Now, 120001 * 30 * 24)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddHours(DateTime.Now, -120001 * 30 * 24)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddHours(DateTime.Now, 120001 * 30 * 24)); } [Theory] [MemberData(nameof(Calendars_TestData))] public static void AddMinutes_Invalid(Calendar calendar) { - Assert.Throws<ArgumentException>(() => calendar.AddMinutes(calendar.MaxSupportedDateTime, 1)); - Assert.Throws<ArgumentException>(() => calendar.AddMinutes(calendar.MinSupportedDateTime, -1)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddMinutes(calendar.MaxSupportedDateTime, 1)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddMinutes(calendar.MinSupportedDateTime, -1)); } [Theory] [MemberData(nameof(Calendars_TestData))] public static void AddSeconds_Invalid(Calendar calendar) { - Assert.Throws<ArgumentException>(() => calendar.AddSeconds(calendar.MaxSupportedDateTime, 1)); - Assert.Throws<ArgumentException>(() => calendar.AddSeconds(calendar.MinSupportedDateTime, -1)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddSeconds(calendar.MaxSupportedDateTime, 1)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddSeconds(calendar.MinSupportedDateTime, -1)); } [Theory] [MemberData(nameof(Calendars_TestData))] public static void AddMilliseconds_Invalid(Calendar calendar) { - Assert.Throws<ArgumentException>(() => calendar.AddMilliseconds(calendar.MaxSupportedDateTime, 1)); - Assert.Throws<ArgumentException>(() => calendar.AddMilliseconds(calendar.MinSupportedDateTime, -1)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddMilliseconds(calendar.MaxSupportedDateTime, 1)); + AssertExtensions.Throws<ArgumentException>(null, () => calendar.AddMilliseconds(calendar.MinSupportedDateTime, -1)); } [Theory] |