Imported Upstream version 5.8.0.22

Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-10-19 20:04:20 +00:00
parent 5f4a27cc8a
commit 7d05485754
5020 changed files with 114082 additions and 186061 deletions

View File

@@ -28,7 +28,7 @@ namespace System.Globalization.Tests
public void CurrencyDecimalSeparator_Set_Invalid()
{
AssertExtensions.Throws<ArgumentNullException>("CurrencyDecimalSeparator", () => new NumberFormatInfo().CurrencyDecimalSeparator = null);
Assert.Throws<ArgumentException>(() => new NumberFormatInfo().CurrencyDecimalSeparator = "");
AssertExtensions.Throws<ArgumentException>(null, () => new NumberFormatInfo().CurrencyDecimalSeparator = "");
Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.CurrencyDecimalSeparator = "string");
}
}

View File

@@ -26,13 +26,11 @@ namespace System.Globalization.Tests
RemoteInvoke((cultureName) =>
{
if (cultureName.Equals("EmptyString"))
cultureName = string.Empty;
CultureInfo newCulture = new CultureInfo(cultureName);
CultureInfo.CurrentCulture = newCulture;
Assert.Same(newCulture.NumberFormat, NumberFormatInfo.CurrentInfo);
return SuccessExitCode;
}, newCurrentCulture.Name.Length > 0 ? newCurrentCulture.Name : "EmptyString").Dispose();
}, newCurrentCulture.Name).Dispose();
}
[Fact]

View File

@@ -17,6 +17,7 @@ namespace System.Globalization.Tests
|| (PlatformDetection.IsUbuntu && !PlatformDetection.IsUbuntu1404)
|| PlatformDetection.IsFedora
|| (PlatformDetection.IsDebian && !PlatformDetection.IsDebian8)
|| PlatformDetection.IsTizen
)
{
return new int[] { 3 };

View File

@@ -28,7 +28,7 @@ namespace System.Globalization.Tests
public void NumberDecimalSeparator_Set_Invalid()
{
AssertExtensions.Throws<ArgumentNullException>("NumberDecimalSeparator", () => new NumberFormatInfo().NumberDecimalSeparator = null);
Assert.Throws<ArgumentException>(() => new NumberFormatInfo().NumberDecimalSeparator = "");
AssertExtensions.Throws<ArgumentException>(null, () => new NumberFormatInfo().NumberDecimalSeparator = "");
Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.NumberDecimalSeparator = "string");
}
}

View File

@@ -28,7 +28,7 @@ namespace System.Globalization.Tests
public void PercentDecimalSeparator_Set_Invalid()
{
AssertExtensions.Throws<ArgumentNullException>("PercentDecimalSeparator", () => new NumberFormatInfo().PercentDecimalSeparator = null);
Assert.Throws<ArgumentException>(() => new NumberFormatInfo().PercentDecimalSeparator = "");
AssertExtensions.Throws<ArgumentException>(null, () => new NumberFormatInfo().PercentDecimalSeparator = "");
Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PercentDecimalSeparator = "string");
}
}

View File

@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using Xunit;
namespace System.Globalization.Tests
@@ -10,15 +9,15 @@ namespace System.Globalization.Tests
public class NumberFormatInfoValidateParseStyle
{
[Theory]
[InlineData(unchecked((NumberStyles)0xFFFFFC00), false)]
[InlineData(NumberStyles.HexNumber | NumberStyles.Integer, false)]
[InlineData(NumberStyles.AllowHexSpecifier, true)]
[InlineData(NumberStyles.None, true)]
public void ValidateParseStyle_Integer(NumberStyles style, bool valid)
[InlineData(unchecked((NumberStyles)0xFFFFFC00), false, "style")]
[InlineData(NumberStyles.HexNumber | NumberStyles.Integer, false, null)]
[InlineData(NumberStyles.AllowHexSpecifier, true, null)]
[InlineData(NumberStyles.None, true, null)]
public void ValidateParseStyle_Integer(NumberStyles style, bool valid, string paramName)
{
if (!valid)
{
Assert.Throws<ArgumentException>(() => byte.Parse("0", style));
AssertExtensions.Throws<ArgumentException>(paramName, () => byte.Parse("0", style));
}
else
{
@@ -27,15 +26,15 @@ namespace System.Globalization.Tests
}
[Theory]
[InlineData(unchecked((NumberStyles)0xFFFFFC00), false)]
[InlineData(NumberStyles.HexNumber | NumberStyles.Integer, false)]
[InlineData(NumberStyles.AllowHexSpecifier, false)]
[InlineData(NumberStyles.None, true)]
public void ValidateParseStyle_Float(NumberStyles style, bool valid)
[InlineData(unchecked((NumberStyles)0xFFFFFC00), false, "style")]
[InlineData(NumberStyles.HexNumber | NumberStyles.Integer, false, null)]
[InlineData(NumberStyles.AllowHexSpecifier, false, null)]
[InlineData(NumberStyles.None, true, null)]
public void ValidateParseStyle_Float(NumberStyles style, bool valid, string paramName)
{
if (!valid)
{
Assert.Throws<ArgumentException>(() => float.Parse("0", style));
AssertExtensions.Throws<ArgumentException>(paramName, () => float.Parse("0", style));
}
else
{

View File

@@ -131,9 +131,6 @@
<Compile Include="TextInfo\TextInfoToUpper.cs" />
<Compile Include="UnicodeCategory\UnicodeCategoryTests.cs" />
<!-- Helpers -->
<Compile Include="$(CommonTestPath)\System\AssertExtensions.cs">
<Link>Common\System\AssertExtensions.cs</Link>
</Compile>
<Compile Include="$(CommonTestPath)\System\PlatformDetection.cs">
<Link>Common\System\PlatformDetection.cs</Link>
</Compile>
@@ -143,22 +140,12 @@
<Compile Include="$(CommonTestPath)\System\RandomDataGenerator.cs">
<Link>Common\System\RandomDataGenerator.cs</Link>
</Compile>
<Compile Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorTestBase.cs">
<Link>Common\System\Diagnostics\RemoteExecutorTestBase.cs</Link>
</Compile>
<Compile Include="$(CommonTestPath)\System\IO\FileCleanupTestBase.cs">
<Link>Common\System\IO\FileCleanupTestBase.cs</Link>
</Compile>
<ProjectReference Condition="'$(TargetGroup)' != 'uap'" Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
<Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
<Name>RemoteExecutorConsoleApp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'uap'">
<Reference Include="Windows" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(CommonTestPath)\Data\UnicodeData.8.0.txt">
<Link>CharUnicodeInfo\UnicodeData8.0.txt</Link>