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.Drawing.Primitives | |
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.Drawing.Primitives')
-rw-r--r-- | src/System.Drawing.Primitives/tests/ColorTests.cs | 16 | ||||
-rw-r--r-- | src/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj | 9 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/System.Drawing.Primitives/tests/ColorTests.cs b/src/System.Drawing.Primitives/tests/ColorTests.cs index cb80989bdd..2212342a72 100644 --- a/src/System.Drawing.Primitives/tests/ColorTests.cs +++ b/src/System.Drawing.Primitives/tests/ColorTests.cs @@ -299,11 +299,11 @@ namespace System.Drawing.Primitives.Tests [MemberData(nameof(InvalidValues))] public void FromArgb_InvalidAlpha(int alpha) { - Assert.Throws<ArgumentException>(() => + AssertExtensions.Throws<ArgumentException>(null, () => { Color.FromArgb(alpha, Color.Red); }); - Assert.Throws<ArgumentException>(() => + AssertExtensions.Throws<ArgumentException>(null, () => { Color.FromArgb(alpha, 0, 0, 0); }); @@ -313,11 +313,11 @@ namespace System.Drawing.Primitives.Tests [MemberData(nameof(InvalidValues))] public void FromArgb_InvalidRed(int red) { - Assert.Throws<ArgumentException>(() => + AssertExtensions.Throws<ArgumentException>(null, () => { Color.FromArgb(red, 0, 0); }); - Assert.Throws<ArgumentException>(() => + AssertExtensions.Throws<ArgumentException>(null, () => { Color.FromArgb(0, red, 0, 0); }); @@ -327,11 +327,11 @@ namespace System.Drawing.Primitives.Tests [MemberData(nameof(InvalidValues))] public void FromArgb_InvalidGreen(int green) { - Assert.Throws<ArgumentException>(() => + AssertExtensions.Throws<ArgumentException>(null, () => { Color.FromArgb(0, green, 0); }); - Assert.Throws<ArgumentException>(() => + AssertExtensions.Throws<ArgumentException>(null, () => { Color.FromArgb(0, 0, green, 0); }); @@ -341,11 +341,11 @@ namespace System.Drawing.Primitives.Tests [MemberData(nameof(InvalidValues))] public void FromArgb_InvalidBlue(int blue) { - Assert.Throws<ArgumentException>(() => + AssertExtensions.Throws<ArgumentException>(null, () => { Color.FromArgb(0, 0, blue); }); - Assert.Throws<ArgumentException>(() => + AssertExtensions.Throws<ArgumentException>(null, () => { Color.FromArgb(0, 0, 0, blue); }); diff --git a/src/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj b/src/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj index 6201723711..fa5c15ceac 100644 --- a/src/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj +++ b/src/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj @@ -20,11 +20,14 @@ <Compile Include="SizeTests.cs" /> <Compile Include="ColorTests.cs" /> <Compile Include="SerializationTests.cs" /> - <Compile Include="$(CommonTestPath)\System\Diagnostics\DebuggerAttributes.cs"> - <Link>Common\System\Diagnostics\DebuggerAttributes.cs</Link> + <Compile Include="$(CommonTestPath)\System\AssertExtensions.cs"> + <Link>Common\System\AssertExtensions.cs</Link> </Compile> <Compile Include="$(CommonTestPath)\System\PlatformDetection.cs"> - <Link>CommonTest\System\PlatformDetection.cs</Link> + <Link>Common\System\PlatformDetection.cs</Link> + </Compile> + <Compile Include="$(CommonTestPath)\System\Diagnostics\DebuggerAttributes.cs"> + <Link>Common\System\Diagnostics\DebuggerAttributes.cs</Link> </Compile> <Compile Include="$(CommonTestPath)\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs"> <Link>Common\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs</Link> |