Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 4456c12

Browse files
author
Atsushi Kanamori
committed
Fix all System.Text.Encodings.Web.Tests failures on ILC
More ParamNames testing...
1 parent 064e0d8 commit 4456c12

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/System.Text.Encodings.Web/tests/System.Text.Encodings.Web.Tests.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@
4343
<Compile Include="UnicodeRangeTests.cs" />
4444
<Compile Include="UrlEncoderTests.cs" />
4545
</ItemGroup>
46+
<ItemGroup>
47+
<Compile Include="$(CommonTestPath)\System\AssertExtensions.cs">
48+
<Link>Common\System\AssertExtensions.cs</Link>
49+
</Compile>
50+
<Compile Include="$(CommonTestPath)\System\PlatformDetection.cs">
51+
<Link>Common\System\PlatformDetection.cs</Link>
52+
</Compile>
53+
</ItemGroup>
4654
<ItemGroup>
4755
<EmbeddedResource Include="$(CommonTestPath)\Data\UnicodeData.8.0.txt">
4856
<LogicalName>UnicodeData.8.0.txt</LogicalName>

src/System.Text.Encodings.Web/tests/UnicodeRangeTests.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,15 @@ public class UnicodeRangeTests
1616
[InlineData(0x10000, 16)]
1717
public void Ctor_FailureCase_FirstCodePoint(int firstCodePoint, int rangeSize)
1818
{
19-
var ex = Assert.Throws<ArgumentOutOfRangeException>(() => new UnicodeRange(firstCodePoint, rangeSize));
20-
Assert.Equal("firstCodePoint", ex.ParamName);
19+
AssertExtensions.Throws<ArgumentOutOfRangeException>("firstCodePoint", () => new UnicodeRange(firstCodePoint, rangeSize));
2120
}
2221

2322
[Theory]
2423
[InlineData(0x0100, -1)]
2524
[InlineData(0x0100, 0x10000)]
2625
public void Ctor_FailureCase_RangeSize(int firstCodePoint, int rangeSize)
2726
{
28-
var ex = Assert.Throws<ArgumentOutOfRangeException>(() => new UnicodeRange(firstCodePoint, rangeSize));
29-
Assert.Equal("length", ex.ParamName);
27+
AssertExtensions.Throws<ArgumentOutOfRangeException>("length", () => new UnicodeRange(firstCodePoint, rangeSize));
3028
}
3129

3230
[Fact]
@@ -43,8 +41,7 @@ public void Ctor_SuccessCase()
4341
[Fact]
4442
public void FromSpan_FailureCase()
4543
{
46-
var ex = Assert.Throws<ArgumentOutOfRangeException>(() => UnicodeRange.Create('\u0020', '\u0010'));
47-
Assert.Equal("lastCharacter", ex.ParamName);
44+
AssertExtensions.Throws<ArgumentOutOfRangeException>("lastCharacter", () => UnicodeRange.Create('\u0020', '\u0010'));
4845
}
4946

5047
[Fact]

0 commit comments

Comments
 (0)