Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen A. Imhoff <clockwork-muse@outlook.com>2016-12-28 08:18:02 +0300
committerEric Mellino <erme@microsoft.com>2017-01-04 23:24:43 +0300
commit2d6677a598f5e388a69d5516acb851bafa70428b (patch)
treee25480773feac70a346e0cacf1015dd45168f853 /src
parent9208b96ab38cb4405be040306215876de81a3a6c (diff)
Change expected behavior for reported parameter names
Diffstat (limited to 'src')
-rw-r--r--src/Common/tests/System/RuntimeDetection.cs2
-rw-r--r--src/System.Runtime/tests/System.Runtime.Tests.csproj3
-rw-r--r--src/System.Runtime/tests/System/Text/StringBuilderTests.cs21
-rw-r--r--src/System.Text.Encoding/tests/Fallback/EncoderExceptionFallbackTests.cs3
-rw-r--r--src/System.Text.Encoding/tests/Fallback/EncoderReplacementFallbackTests.cs3
-rw-r--r--src/System.Text.Encoding/tests/System.Text.Encoding.Tests.csproj5
6 files changed, 26 insertions, 11 deletions
diff --git a/src/Common/tests/System/RuntimeDetection.cs b/src/Common/tests/System/RuntimeDetection.cs
index 28cd49557c..2d9008f6e8 100644
--- a/src/Common/tests/System/RuntimeDetection.cs
+++ b/src/Common/tests/System/RuntimeDetection.cs
@@ -12,7 +12,7 @@ namespace System
private static readonly string s_frameworkDescription = RuntimeInformation.FrameworkDescription;
// public static bool IsMono { get; } = Type.GetType("Mono.Runtime") != null;
- // public static bool IsNetFramework { get; } = s_frameworkDescription.StartsWith(".NET Framework");
+ public static bool IsNetFramework { get; } = s_frameworkDescription.StartsWith(".NET Framework");
// public static bool IsCoreclr { get; } = s_frameworkDescription.StartsWith(".NET Core");
public static bool IsNetNative { get; } = s_frameworkDescription.StartsWith(".NET Native");
}
diff --git a/src/System.Runtime/tests/System.Runtime.Tests.csproj b/src/System.Runtime/tests/System.Runtime.Tests.csproj
index 76371aa979..51c1bbe350 100644
--- a/src/System.Runtime/tests/System.Runtime.Tests.csproj
+++ b/src/System.Runtime/tests/System.Runtime.Tests.csproj
@@ -100,6 +100,9 @@
<Compile Include="$(CommonTestPath)\System\PlatformDetection.cs">
<Link>Common\System\PlatformDetection.cs</Link>
</Compile>
+ <Compile Include="$(CommonTestPath)\System\RuntimeDetection.cs">
+ <Link>Common\System\RuntimeDetection.cs</Link>
+ </Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp1.1'">
<Compile Include="System\ArrayTests.netcoreapp1.1.cs" />
diff --git a/src/System.Runtime/tests/System/Text/StringBuilderTests.cs b/src/System.Runtime/tests/System/Text/StringBuilderTests.cs
index 8914b81880..b711fb3eff 100644
--- a/src/System.Runtime/tests/System/Text/StringBuilderTests.cs
+++ b/src/System.Runtime/tests/System/Text/StringBuilderTests.cs
@@ -628,10 +628,13 @@ namespace System.Text.Tests
Assert.Throws<ArgumentNullException>("value", () => builder.Append((char[])null, 1, 1)); // Value is null, startIndex > 0 and count > 0
Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => builder.Append(new char[0], -1, 0)); // Start index < 0
- Assert.Throws<ArgumentOutOfRangeException>("count", () => builder.Append(new char[0], 0, -1)); // Count < 0
+ Assert.Throws<ArgumentOutOfRangeException>(
+ RuntimeDetection.IsNetFramework ? "count" : "charCount", () => builder.Append(new char[0], 0, -1)); // Count < 0
- Assert.Throws<ArgumentOutOfRangeException>("count", () => builder.Append(new char[5], 6, 0)); // Start index + count > value.Length
- Assert.Throws<ArgumentOutOfRangeException>("count", () => builder.Append(new char[5], 5, 1)); // Start index + count > value.Length
+ Assert.Throws<ArgumentOutOfRangeException>(
+ RuntimeDetection.IsNetFramework ? "count" : "charCount", () => builder.Append(new char[5], 6, 0)); // Start index + count > value.Length
+ Assert.Throws<ArgumentOutOfRangeException>(
+ RuntimeDetection.IsNetFramework ? "count" : "charCount", () => builder.Append(new char[5], 5, 1)); // Start index + count > value.Length
Assert.Throws<ArgumentOutOfRangeException>("valueCount", () => builder.Append(new char[] { 'a' })); // New length > builder.MaxCapacity
Assert.Throws<ArgumentOutOfRangeException>("valueCount", () => builder.Append(new char[] { 'a' }, 0, 1)); // New length > builder.MaxCapacity
@@ -1392,9 +1395,9 @@ namespace System.Text.Tests
Assert.Throws<ArgumentOutOfRangeException>("index", () => builder.Insert(builder.Length + 1, new char[0], 0, 0)); // Index > builder.Length
Assert.Throws<ArgumentNullException>(() => builder.Insert(0, null, 1, 1)); // Value is null (startIndex and count are not zero)
+ Assert.Throws<ArgumentOutOfRangeException>(RuntimeDetection.IsNetFramework ? "count" : "charCount", () => builder.Insert(0, new char[0], 0, -1)); // Char count < 0
Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => builder.Insert(0, new char[0], -1, 0)); // Start index < 0
- Assert.Throws<ArgumentOutOfRangeException>("count", () => builder.Insert(0, new char[0], 0, -1)); // Char count < 0
Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => builder.Insert(0, new char[3], 4, 0)); // Start index + char count > value.Length
Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => builder.Insert(0, new char[3], 3, 1)); // Start index + char count > value.Length
@@ -1436,10 +1439,12 @@ namespace System.Text.Tests
var builder = new StringBuilder("Hello");
Assert.Throws<ArgumentOutOfRangeException>("startIndex", () => builder.Remove(-1, 0)); // Start index < 0
Assert.Throws<ArgumentOutOfRangeException>("length", () => builder.Remove(0, -1)); // Length < 0
-
- Assert.Throws<ArgumentOutOfRangeException>("index", () => builder.Remove(6, 0)); // Start index + length > 0
- Assert.Throws<ArgumentOutOfRangeException>("index", () => builder.Remove(5, 1)); // Start index + length > 0
- Assert.Throws<ArgumentOutOfRangeException>("index", () => builder.Remove(4, 2)); // Start index + length > 0
+ Assert.Throws<ArgumentOutOfRangeException>(
+ RuntimeDetection.IsNetFramework ? "index" : "length", () => builder.Remove(6, 0)); // Start index + length > 0
+ Assert.Throws<ArgumentOutOfRangeException>(
+ RuntimeDetection.IsNetFramework ? "index" : "length", () => builder.Remove(5, 1)); // Start index + length > 0
+ Assert.Throws<ArgumentOutOfRangeException>(
+ RuntimeDetection.IsNetFramework ? "index" : "length", () => builder.Remove(4, 2)); // Start index + length > 0
}
[Theory]
diff --git a/src/System.Text.Encoding/tests/Fallback/EncoderExceptionFallbackTests.cs b/src/System.Text.Encoding/tests/Fallback/EncoderExceptionFallbackTests.cs
index f82f925039..dc5eb21d95 100644
--- a/src/System.Text.Encoding/tests/Fallback/EncoderExceptionFallbackTests.cs
+++ b/src/System.Text.Encoding/tests/Fallback/EncoderExceptionFallbackTests.cs
@@ -54,7 +54,8 @@ namespace System.Text.Tests
EncoderFallbackBuffer buffer = new EncoderExceptionFallback().CreateFallbackBuffer();
Assert.Throws<ArgumentOutOfRangeException>("charUnknownHigh", () => buffer.Fallback('a', '\uDC00', 0));
- Assert.Throws<ArgumentOutOfRangeException>("CharUnknownLow", () => buffer.Fallback('\uD800', 'a', 0));
+ Assert.Throws<ArgumentOutOfRangeException>(
+ RuntimeDetection.IsNetFramework ? "CharUnknownLow" : "charUnknownLow", () => buffer.Fallback('\uD800', 'a', 0));
}
}
}
diff --git a/src/System.Text.Encoding/tests/Fallback/EncoderReplacementFallbackTests.cs b/src/System.Text.Encoding/tests/Fallback/EncoderReplacementFallbackTests.cs
index 09c8105490..43275a4bd5 100644
--- a/src/System.Text.Encoding/tests/Fallback/EncoderReplacementFallbackTests.cs
+++ b/src/System.Text.Encoding/tests/Fallback/EncoderReplacementFallbackTests.cs
@@ -109,7 +109,8 @@ namespace System.Text.Tests
EncoderFallbackBuffer buffer = new EncoderReplacementFallback().CreateFallbackBuffer();
Assert.Throws<ArgumentOutOfRangeException>("charUnknownHigh", () => buffer.Fallback('a', '\uDC00', 0));
- Assert.Throws<ArgumentOutOfRangeException>("CharUnknownLow", () => buffer.Fallback('\uD800', 'a', 0));
+ Assert.Throws<ArgumentOutOfRangeException>(
+ RuntimeDetection.IsNetFramework ? "CharUnknownLow" : "charUnknownLow", () => buffer.Fallback('\uD800', 'a', 0));
}
}
}
diff --git a/src/System.Text.Encoding/tests/System.Text.Encoding.Tests.csproj b/src/System.Text.Encoding/tests/System.Text.Encoding.Tests.csproj
index 580c36319d..2bccfc313d 100644
--- a/src/System.Text.Encoding/tests/System.Text.Encoding.Tests.csproj
+++ b/src/System.Text.Encoding/tests/System.Text.Encoding.Tests.csproj
@@ -79,5 +79,10 @@
<Compile Include="Decoder\Decoder.netstandard1.7.cs" />
<Compile Include="Encoder\Encoder.netstandard1.7.cs" />
</ItemGroup>
+ <ItemGroup>
+ <Compile Include="$(CommonTestPath)\System\RuntimeDetection.cs">
+ <Link>Common\System\RuntimeDetection.cs</Link>
+ </Compile>
+ </ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project> \ No newline at end of file