[master] Update dependencies from dotnet/coreclr (dotnet/corefx#35891)
authordotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Sat, 9 Mar 2019 05:00:44 +0000 (05:00 +0000)
committerGitHub <noreply@github.com>
Sat, 9 Mar 2019 05:00:44 +0000 (05:00 +0000)
* Update dependencies from https://github.com/dotnet/coreclr build 20190307.75

This change updates the following dependencies
- Microsoft.NET.Sdk.IL - 3.0.0-preview4-27507-75
- Microsoft.NETCore.ILAsm - 3.0.0-preview4-27507-75
- Microsoft.NETCore.Runtime.CoreCLR - 3.0.0-preview4-27507-75

* Update tests for globalization cleanup

* Fix NegativeSign_SetNull_ThrowsArgumentNullException test with updated arg name

Commit migrated from https://github.com/dotnet/corefx/commit/e45615101e28fac1a89414e701fee4e4be84a4fc

27 files changed:
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyDecimalDigits.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyDecimalSeparator.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyGroupSeparator.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyGroupSizes.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyNegativePattern.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyPositivePattern.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencySymbol.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoNaNSymbol.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoNegativeInfinitySymbol.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoNegativeSign.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoNumberDecimalDigits.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoNumberDecimalSeparator.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoNumberGroupSeparator.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoNumberGroupSizes.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoNumberNegativePattern.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPerMilleSymbol.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentDecimalDigits.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentDecimalSeparator.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentGroupSeparator.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentGroupSizes.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentNegativePattern.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentPositivePattern.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPercentSymbol.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPositiveInfinitySymbol.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoPositiveSign.cs
src/libraries/System.Globalization/tests/StringInfo/StringInfoCtor.cs
src/libraries/System.Globalization/tests/StringInfo/StringInfoString.cs

index 950e6d3..475c74f 100644 (file)
@@ -3,7 +3,6 @@
 // See the LICENSE file in the project root for more information.
 
 using System.Collections.Generic;
-using System.Runtime.InteropServices;
 using Xunit;
 
 namespace System.Globalization.Tests
@@ -19,9 +18,9 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(CurrencyDecimalDigits_TestData))]
-        public void CurrencyDecimalDigits_Get(NumberFormatInfo format, int expectedWindows, int expectedIcu)
+        public void CurrencyDecimalDigits_Get_ReturnsExpected(NumberFormatInfo format, int expectedWindows, int expectedIcu)
         {
-            int expected = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? expectedWindows : expectedIcu;
+            int expected = PlatformDetection.IsWindows ? expectedWindows : expectedIcu;
             Assert.Equal(expected, format.CurrencyDecimalDigits);
         }
 
@@ -29,18 +28,25 @@ namespace System.Globalization.Tests
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(99)]
-        public void CurrencyDecimalDigits_Set(int newCurrencyDecimalDigits)
+        public void CurrencyDecimalDigits_Set_GetReturnsExpected(int newCurrencyDecimalDigits)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.CurrencyDecimalDigits = newCurrencyDecimalDigits;
             Assert.Equal(newCurrencyDecimalDigits, format.CurrencyDecimalDigits);
         }
 
+        [Theory]
+        [InlineData(-1)]
+        [InlineData(100)]
+        public void CurrencyDecimalDigits_SetInvalid_ThrowsArgumentOutOfRangeException(int value)
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentOutOfRangeException>("value", "CurrencyDecimalDigits", () => format.CurrencyDecimalDigits = value);
+        }
+
         [Fact]
-        public void CurrencyDecimalDigits_Set_Invalid()
+        public void CurrencyDecimalDigits_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("CurrencyDecimalDigits", () => new NumberFormatInfo().CurrencyDecimalDigits = -1);
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("CurrencyDecimalDigits", () => new NumberFormatInfo().CurrencyDecimalDigits = 100);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.CurrencyDecimalDigits = 2);
         }
     }
index 1d82067..dadd277 100644 (file)
@@ -27,8 +27,20 @@ namespace System.Globalization.Tests
         [Fact]
         public void CurrencyDecimalSeparator_Set_Invalid()
         {
-            AssertExtensions.Throws<ArgumentNullException>("CurrencyDecimalSeparator", () => new NumberFormatInfo().CurrencyDecimalSeparator = null);
-            AssertExtensions.Throws<ArgumentException>(null, () => new NumberFormatInfo().CurrencyDecimalSeparator = "");
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "CurrencyDecimalSeparator", () => format.CurrencyDecimalSeparator = null);
+        }
+
+        [Fact]
+        public void CurrencyDecimalSeparator_SetEmpty_ThrowsArgumentException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentException>("value", null, () => format.CurrencyDecimalSeparator = "");
+        }
+        
+        [Fact]
+        public void CurrencyDecimalSeparator_SetReadOnly_ThrowsInvalidOperationException()
+        {
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.CurrencyDecimalSeparator = "string");
         }
     }
index 0f7d742..20fd472 100644 (file)
@@ -9,7 +9,7 @@ namespace System.Globalization.Tests
     public class NumberFormatInfoCurrencyGroupSeparator
     {
         [Fact]
-        public void CurrencyGroupSeparator_Get_InvariantInfo()
+        public void CurrencyGroupSeparator_GetInvariantInfo_ReturnsExpected()
         {
             Assert.Equal(",", NumberFormatInfo.InvariantInfo.CurrencyGroupSeparator);
         }
@@ -18,7 +18,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("    ")]
         [InlineData("")]
-        public void CurrencyGroupSeparator_Set(string newCurrencyGroupSeparator)
+        public void CurrencyGroupSeparator_Set_GetReturnsExpected(string newCurrencyGroupSeparator)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.CurrencyGroupSeparator = newCurrencyGroupSeparator;
@@ -26,9 +26,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void CurrencyGroupSeparator_Set_Invalid()
+        public void CurrencyGroupSeparator_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "CurrencyGroupSeparator", () => format.CurrencyGroupSeparator = null);
+        }
+
+        [Fact]
+        public void CurrencyGroupSeparator_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("CurrencyGroupSeparator", () => new NumberFormatInfo().CurrencyGroupSeparator = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.CurrencyGroupSeparator = "string");
         }
     }
index c9b25d0..60b211d 100644 (file)
@@ -23,7 +23,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(CurrencyGroupSizes_TestData))]
-        public void CurrencyGroupSizes_Get(NumberFormatInfo format, int[] expected)
+        public void CurrencyGroupSizes_Get_ReturnsExpected(NumberFormatInfo format, int[] expected)
         {
             Assert.Equal(expected, format.CurrencyGroupSizes);
         }
@@ -33,7 +33,7 @@ namespace System.Globalization.Tests
         [InlineData(new int[] { 2, 3, 4 })]
         [InlineData(new int[] { 2, 3, 4, 0 })]
         [InlineData(new int[] { 0 })]
-        public void CurrencyGroupSizes_Set(int[] newCurrencyGroupSizes)
+        public void CurrencyGroupSizes_Set_GetReturnsExpected(int[] newCurrencyGroupSizes)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.CurrencyGroupSizes = newCurrencyGroupSizes;
@@ -41,13 +41,25 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void CurrencyGroupSizes_Set_Invalid()
+        public void CurrencyGroupSizes_SetNull_ThrowsArgumentNullException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("CurrencyGroupSizes", () => new NumberFormatInfo().CurrencyGroupSizes = null);
-            AssertExtensions.Throws<ArgumentException>("CurrencyGroupSizes", () => new NumberFormatInfo().CurrencyGroupSizes = new int[] { -1, 1, 2 });
-            AssertExtensions.Throws<ArgumentException>("CurrencyGroupSizes", () => new NumberFormatInfo().CurrencyGroupSizes = new int[] { 98, 99, 100 });
-            AssertExtensions.Throws<ArgumentException>("CurrencyGroupSizes", () => new NumberFormatInfo().CurrencyGroupSizes = new int[] { 0, 1, 2 });
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "CurrencyGroupSizes", () => format.CurrencyGroupSizes = null);
+        }
 
+        [Theory]
+        [InlineData(new int[] { -1, 1, 2 })]
+        [InlineData(new int[] { 98, 99, 100 })]
+        [InlineData(new int[] { 0, 1, 2 })]
+        public void CurrencyGroupSizes_SetInvalid_ThrowsArgumentException(int[] value)
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentException>("value", "CurrencyGroupSizes", () => format.CurrencyGroupSizes = value);
+        }
+
+        [Fact]
+        public void CurrencyGroupSizes_SetReadOnly_ThrowsInvalidOperationException()
+        {
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.CurrencyGroupSizes = new int[] { 1, 2, 3 });
         }
     }
index 1e436d2..c39cc7c 100644 (file)
@@ -18,7 +18,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(CurrencyNegativePattern_TestData))]
-        public void CurrencyNegativePattern_Get(NumberFormatInfo format, int[] acceptablePatterns)
+        public void CurrencyNegativePattern_Get_ReturnsExpected(NumberFormatInfo format, int[] acceptablePatterns)
         {
             Assert.Contains(format.CurrencyNegativePattern, acceptablePatterns);
         }
@@ -31,7 +31,7 @@ namespace System.Globalization.Tests
         [InlineData("as")]
         [InlineData("es-BO")]
         [InlineData("fr-CA")]
-        public void CurrencyNegativePattern_Get(string locale)
+        public void CurrencyNegativePattern_Get_ReturnsExpected(string locale)
         {
             CultureInfo culture; 
             try
@@ -51,18 +51,25 @@ namespace System.Globalization.Tests
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(15)]
-        public void CurrencyNegativePattern_Set(int newCurrencyNegativePattern)
+        public void CurrencyNegativePattern_Set_GetReturnsExpected(int newCurrencyNegativePattern)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.CurrencyNegativePattern = newCurrencyNegativePattern;
             Assert.Equal(newCurrencyNegativePattern, format.CurrencyNegativePattern);
         }
 
+        [Theory]
+        [InlineData(-1)]
+        [InlineData(16)]
+        public void CurrencyNegativePattern_SetInvalid_ThrowsArgumentOutOfRangeException(int value)
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentOutOfRangeException>("value", "CurrencyNegativePattern", () => format.CurrencyNegativePattern = -1);
+        }
+
         [Fact]
-        public void CurrencyNegativePattern_Set_Invalid()
+        public void CurrencyNegativePattern_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("CurrencyNegativePattern", () => new NumberFormatInfo().CurrencyNegativePattern = -1);
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("CurrencyNegativePattern", () => new NumberFormatInfo().CurrencyNegativePattern = 16);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.CurrencyNegativePattern = 1);
         }
     }
index 90a5b7c..50dddd1 100644 (file)
@@ -18,7 +18,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(CurrencyPositivePattern_TestData))]
-        public void CurrencyPositivePattern_Get(NumberFormatInfo format, int expected)
+        public void CurrencyPositivePattern_Get_ReturnsExpected(NumberFormatInfo format, int expected)
         {
             Assert.Equal(expected, format.CurrencyPositivePattern);
         }
@@ -27,18 +27,25 @@ namespace System.Globalization.Tests
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(3)]
-        public void CurrencyPositivePattern_Set(int newCurrencyPositivePattern)
+        public void CurrencyPositivePattern_Set_GetReturnsExpected(int newCurrencyPositivePattern)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.CurrencyPositivePattern = newCurrencyPositivePattern;
             Assert.Equal(newCurrencyPositivePattern, format.CurrencyPositivePattern);
         }
 
+        [Theory]
+        [InlineData(-1)]
+        [InlineData(4)]
+        public void CurrencyPositivePattern_SetInvalid_ThrowsArgumentOutOfRangeException(int value)
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentOutOfRangeException>("value", "CurrencyPositivePattern", () => format.CurrencyPositivePattern = value);
+        }
+
         [Fact]
-        public void CurrencyPositivePattern_Set_Invalid()
+        public void CurrencyPositivePattern_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("CurrencyPositivePattern", () => new NumberFormatInfo().CurrencyPositivePattern = -1);
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("CurrencyPositivePattern", () => new NumberFormatInfo().CurrencyPositivePattern = 4);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.CurrencyPositivePattern = 1);
         }
     }
index a68b730..bdabfb4 100644 (file)
@@ -12,7 +12,7 @@ namespace System.Globalization.Tests
         [InlineData("en-US", "$")]
         [InlineData("en-GB", "\x00a3")] // pound
         [InlineData("", "\x00a4")] // international
-        public void CurrencySymbol_Get(string name, string expected)
+        public void CurrencySymbol_Get_ReturnsExpected(string name, string expected)
         {
             Assert.Equal(expected, CultureInfo.GetCultureInfo(name).NumberFormat.CurrencySymbol);
         }
@@ -21,7 +21,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("   ")]
         [InlineData("")]
-        public void CurrencySymbol_Set(string newCurrencySymbol)
+        public void CurrencySymbol_Set_GetReturnsExpected(string newCurrencySymbol)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.CurrencySymbol = newCurrencySymbol;
@@ -29,9 +29,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void CurrencySymbol_Set_Invalid()
+        public void CurrencySymbol_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "CurrencySymbol", () => format.CurrencySymbol = null);
+        }
+
+        [Fact]
+        public void CurrencySymbol_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("CurrencySymbol", () => new NumberFormatInfo().CurrencySymbol = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.CurrencySymbol = "");
         }
     }
index a86d413..283b03c 100644 (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,7 +9,7 @@ namespace System.Globalization.Tests
     public class NumberFormatInfoNaNSymbol
     {
         [Fact]
-        public void NaNSymbol_Get_InvariantInfo()
+        public void NaNSymbol_GetInvariantInfo_ReturnsExpected()
         {
             Assert.Equal("NaN", NumberFormatInfo.InvariantInfo.NaNSymbol);
         }
@@ -19,7 +18,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("   ")]
         [InlineData("")]
-        public void NaNSymbol_Set(string newNaNSymbol)
+        public void NaNSymbol_Set_GetReturnsExpected(string newNaNSymbol)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.NaNSymbol = newNaNSymbol;
@@ -27,9 +26,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void NaNSymbol_Set_Invalid()
+        public void NaNSymbol_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "NaNSymbol", () => format.NaNSymbol = null);
+        }
+
+        [Fact]
+        public void NaNSymbol_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("NaNSymbol", () => new NumberFormatInfo().NaNSymbol = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.NaNSymbol = "");
         }
     }
index 327b76d..48701e9 100644 (file)
@@ -18,7 +18,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(NegativeInfinitySymbol_TestData))]
-        public void NegativeInfinitySymbol_Get(NumberFormatInfo format)
+        public void NegativeInfinitySymbol_Get_ReturnsExpected(NumberFormatInfo format)
         {
             Assert.Equal(float.NegativeInfinity.ToString(format), format.NegativeInfinitySymbol);
         }
@@ -27,7 +27,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("   ")]
         [InlineData("")]
-        public void NegativeInfinitySymbol_Set(string newNegativeInfinitySymbol)
+        public void NegativeInfinitySymbol_Set_GetReturnsExpected(string newNegativeInfinitySymbol)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.NegativeInfinitySymbol = newNegativeInfinitySymbol;
@@ -35,9 +35,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void NegativeInfinitySymbol_Set_Invalid()
+        public void NegativeInfinitySymbol_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "NegativeInfinitySymbol", () => format.NegativeInfinitySymbol = null);
+        }
+
+        [Fact]
+        public void NegativeInfinitySymbol_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("NegativeInfinitySymbol", () => new NumberFormatInfo().NegativeInfinitySymbol = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.NegativeInfinitySymbol = "");
         }
     }
index 5949f32..ea57608 100644 (file)
@@ -17,7 +17,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(NegativeSign_TestData))]
-        public void NegativeSign_Get(NumberFormatInfo format, string expected)
+        public void NegativeSign_Get_ReturnsExpected(NumberFormatInfo format, string expected)
         {
             Assert.Equal(expected, format.NegativeSign);
         }
@@ -26,7 +26,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("   ")]
         [InlineData("")]
-        public void NegativeSign_Set(string newNegativeSign)
+        public void NegativeSign_Set_GetReturnsExpected(string newNegativeSign)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.NegativeSign = newNegativeSign;
@@ -34,9 +34,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void NegativeSign_Set_Invalid()
+        public void NegativeSign_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "NegativeSign", () => format.NegativeSign = null);
+        }
+
+        [Fact]
+        public void NegativeSign_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("NegativeSign", () => new NumberFormatInfo().NegativeSign = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.NegativeSign = "");
         }
     }
index 030d28b..97c36ca 100644 (file)
@@ -3,7 +3,6 @@
 // See the LICENSE file in the project root for more information.
 
 using System.Collections.Generic;
-using System.Runtime.InteropServices;
 using Xunit;
 
 namespace System.Globalization.Tests
@@ -18,9 +17,9 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(NumberDecimalDigits_TestData))]
-        public void NumberDecimalDigits_Get(NumberFormatInfo format, int expectedWindows, int expectedIcu)
+        public void NumberDecimalDigits_Get_ReturnsExpected(NumberFormatInfo format, int expectedWindows, int expectedIcu)
         {
-            int expected = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? expectedWindows : expectedIcu;
+            int expected = PlatformDetection.IsWindows ? expectedWindows : expectedIcu;
             Assert.Equal(expected, format.NumberDecimalDigits);
         }
 
@@ -28,18 +27,25 @@ namespace System.Globalization.Tests
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(99)]
-        public void NumberDecimalDigits_Set(int newNumberDecimalDigits)
+        public void NumberDecimalDigits_Set_GetReturnsExpected(int newNumberDecimalDigits)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.NumberDecimalDigits = newNumberDecimalDigits;
             Assert.Equal(newNumberDecimalDigits, format.NumberDecimalDigits);
         }
 
+        [Theory]
+        [InlineData(-1)]
+        [InlineData(100)]
+        public void NumberDecimalDigits_SetInvalid_ThrowsArgumentOutOfRangeException(int value)
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentOutOfRangeException>("value", "NumberDecimalDigits", () => format.NumberDecimalDigits = value);
+        }
+        
         [Fact]
-        public void NumberDecimalDigits_Set_Invalid()
+        public void NumberDecimalDigits_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("NumberDecimalDigits", () => new NumberFormatInfo().NumberDecimalDigits = -1);
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("NumberDecimalDigits", () => new NumberFormatInfo().NumberDecimalDigits = 100);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.NumberDecimalDigits = 1);
         }
     }
index 23c4535..8ee4d7a 100644 (file)
@@ -9,7 +9,7 @@ namespace System.Globalization.Tests
     public class NumberFormatInfoNumberDecimalSeparator
     {
         [Fact]
-        public void NumberDecimalSeparator_Get_InvariantInfo()
+        public void NumberDecimalSeparator_GetInvariantInfo_ReturnsExpected()
         {
             Assert.Equal(".", NumberFormatInfo.InvariantInfo.NumberDecimalSeparator);
         }
@@ -17,7 +17,7 @@ namespace System.Globalization.Tests
         [Theory]
         [InlineData("string")]
         [InlineData("    ")]
-        public void NumberDecimalSeparator_Set(string newNumberDecimalSeparator)
+        public void NumberDecimalSeparator_Set_GetReturnsExpected(string newNumberDecimalSeparator)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.NumberDecimalSeparator = newNumberDecimalSeparator;
@@ -25,10 +25,22 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void NumberDecimalSeparator_Set_Invalid()
+        public void NumberDecimalSeparator_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "NumberDecimalSeparator", () => format.NumberDecimalSeparator = null);
+        }
+
+        [Fact]
+        public void NumberDecimalSeparator_SetEmpty_ThrowsArgumentException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentException>("value", null, () => format.NumberDecimalSeparator = "");
+        }
+
+        [Fact]
+        public void NumberDecimalSeparator_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("NumberDecimalSeparator", () => new NumberFormatInfo().NumberDecimalSeparator = null);
-            AssertExtensions.Throws<ArgumentException>(null, () => new NumberFormatInfo().NumberDecimalSeparator = "");
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.NumberDecimalSeparator = "string");
         }
     }
index a35f3fc..246d989 100644 (file)
@@ -9,7 +9,7 @@ namespace System.Globalization.Tests
     public class NumberFormatInfoNumberGroupSeparator
     {
         [Fact]
-        public void NumberGroupSeparator_Get_InvariantInfo()
+        public void NumberGroupSeparator_GetInvariantInfo_ReturnsExpected()
         {
             Assert.Equal(",", NumberFormatInfo.InvariantInfo.NumberGroupSeparator);
         }
@@ -18,7 +18,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("    ")]
         [InlineData("")]
-        public void NumberGroupSeparator_Set(string newNumberGroupSeparator)
+        public void NumberGroupSeparator_Set_GetReturnsExpected(string newNumberGroupSeparator)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.NumberGroupSeparator = newNumberGroupSeparator;
@@ -26,9 +26,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void NumberGroupSeparator_Set_Invalid()
+        public void NumberGroupSeparator_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "NumberGroupSeparator", () => format.NumberGroupSeparator = null);
+        }
+
+        [Fact]
+        public void NumberGroupSeparator_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("NumberGroupSeparator", () => new NumberFormatInfo().NumberGroupSeparator = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.NumberGroupSeparator = "string");
         }
     }
index fa16372..2938cea 100644 (file)
@@ -23,7 +23,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(NumberGroupSizes_TestData))]
-        public void NumberGroupSizes_Get(NumberFormatInfo format, int[] expected)
+        public void NumberGroupSizes_Get_ReturnsExpected(NumberFormatInfo format, int[] expected)
         {
             Assert.Equal(expected, format.NumberGroupSizes);
         }
@@ -33,7 +33,7 @@ namespace System.Globalization.Tests
         [InlineData(new int[] { 2, 3, 4 })]
         [InlineData(new int[] { 2, 3, 4, 0 })]
         [InlineData(new int[] { 0 })]
-        public void NumberGroupSizes_Set(int[] newNumberGroupSizes)
+        public void NumberGroupSizes_Set_GetReturnsExpected(int[] newNumberGroupSizes)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.NumberGroupSizes = newNumberGroupSizes;
@@ -41,14 +41,25 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void NumberGroupSizes_Set_Invalid()
+        public void NumberGroupSizes_SetNull_ThrowsArgumentNullException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("NumberGroupSizes", () => new NumberFormatInfo().NumberGroupSizes = null);
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "NumberGroupSizes", () => format.NumberGroupSizes = null);
+        }
 
-            AssertExtensions.Throws<ArgumentException>("NumberGroupSizes", () => new NumberFormatInfo().NumberGroupSizes = new int[] { -1, 1, 2 });
-            AssertExtensions.Throws<ArgumentException>("NumberGroupSizes", () => new NumberFormatInfo().NumberGroupSizes = new int[] { 98, 99, 100 });
-            AssertExtensions.Throws<ArgumentException>("NumberGroupSizes", () => new NumberFormatInfo().NumberGroupSizes = new int[] { 0, 1, 2 });
+        [Theory]
+        [InlineData(new int[] { -1, 1, 2 })]
+        [InlineData(new int[] { 98, 99, 100 })]
+        [InlineData(new int[] { 0, 1, 2 })]
+        public void NumberGroupSizes_SetInvalid_ThrowsArgumentException(int[] value)
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentException>("value", "NumberGroupSizes", () => format.NumberGroupSizes = value);
+        }
 
+        [Fact]
+        public void NumberGroupSizes_SetReadOnly_ThrowsInvalidOperationException()
+        {
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.NumberGroupSizes = new int[] { 1, 2, 3 });
         }
     }
index 516fa21..62a5812 100644 (file)
@@ -17,7 +17,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(NumberNegativePattern_TestData))]
-        public void NumberNegativePattern_Get(NumberFormatInfo format, int expected)
+        public void NumberNegativePattern_Get_ReturnsExpected(NumberFormatInfo format, int expected)
         {
             Assert.Equal(expected, format.NumberNegativePattern);
         }
@@ -26,18 +26,26 @@ namespace System.Globalization.Tests
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(4)]
-        public void NumberNegativePattern_Set(int newNumberNegativePattern)
+        public void NumberNegativePattern_Set_GetReturnsExpected(int newNumberNegativePattern)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.NumberNegativePattern = newNumberNegativePattern;
             Assert.Equal(newNumberNegativePattern, format.NumberNegativePattern);
         }
 
+        [Theory]
+        [InlineData(-1)]
+        [InlineData(5)]
+        public void NumberNegativePattern_SetInvalid_ThrowsArgumentOutOfRangeException(int value)
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentOutOfRangeException>("value", "NumberNegativePattern", () => format.NumberNegativePattern = value);
+        }
+
+
         [Fact]
-        public void NumberNegativePattern_Set_Invalid()
+        public void NumberNegativePattern_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("NumberNegativePattern", () => new NumberFormatInfo().NumberNegativePattern = -1);
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("NumberNegativePattern", () => new NumberFormatInfo().NumberNegativePattern = 5);
 
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.NumberNegativePattern = 1);
         }
index ad8cd02..32c4377 100644 (file)
@@ -9,7 +9,7 @@ namespace System.Globalization.Tests
     public class NumberFormatInfoPerMilleSymbol
     {
         [Fact]
-        public void PerMilleSymbol_Get_InvariantInfo()
+        public void PerMilleSymbol_GetInvariantInfo_ReturnsExpected()
         {
             Assert.Equal("\u2030", NumberFormatInfo.InvariantInfo.PerMilleSymbol);
         }
@@ -18,7 +18,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("   ")]
         [InlineData("")]
-        public void PerMilleSymbol_Set(string newPerMilleSymbol)
+        public void PerMilleSymbol_Set_GetReturnsExpected(string newPerMilleSymbol)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.PerMilleSymbol = newPerMilleSymbol;
@@ -26,9 +26,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void PerMilleSymbol_Set_Invalid()
+        public void PerMilleSymbol_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "PerMilleSymbol", () => format.PerMilleSymbol = null);
+        }
+
+        [Fact]
+        public void PerMilleSymbol_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("PerMilleSymbol", () => new NumberFormatInfo().PerMilleSymbol = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PerMilleSymbol = "");
         }
     }
index 0661ae8..3074138 100644 (file)
@@ -9,7 +9,7 @@ namespace System.Globalization.Tests
     public class NumberFormatInfoPercentDecimalDigits
     {
         [Fact]
-        public void PercentDecimalDigits_Get_InvariantInfo()
+        public void PercentDecimalDigits_GetInvariantInfo_ReturnsExpected()
         {
             Assert.Equal(2, NumberFormatInfo.InvariantInfo.PercentDecimalDigits);
         }
@@ -18,18 +18,26 @@ namespace System.Globalization.Tests
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(99)]
-        public void PercentDecimalDigits_Set(int newPercentDecimalDigits)
+        public void PercentDecimalDigits_Set_GetReturnsExpected(int newPercentDecimalDigits)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.PercentDecimalDigits = newPercentDecimalDigits;
             Assert.Equal(newPercentDecimalDigits, format.PercentDecimalDigits);
         }
 
+        [Theory]
+        [InlineData(-1)]
+        [InlineData(100)]
+        public void PercentDecimalDigits_SetInvalid_ThrowsArgumentOutOfRangeException(int value)
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentOutOfRangeException>("value", "PercentDecimalDigits", () => format.PercentDecimalDigits = value);
+        }
+
+
         [Fact]
-        public void PercentDecimalDigits_Set_Invalid()
+        public void PercentDecimalDigits_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("PercentDecimalDigits", () => new NumberFormatInfo().PercentDecimalDigits = -1);
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("PercentDecimalDigits", () => new NumberFormatInfo().PercentDecimalDigits = 100);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PercentDecimalDigits = 1);
         }
     }
index 8df5d29..fa1fb50 100644 (file)
@@ -9,7 +9,7 @@ namespace System.Globalization.Tests
     public class NumberFormatInfoPercentDecimalSeparator
     {
         [Fact]
-        public void PercentDecimalSeparator_Get_InvariantInfo()
+        public void PercentDecimalSeparator_GetInvariantInfo_ReturnsExpected()
         {
             Assert.Equal(".", NumberFormatInfo.InvariantInfo.PercentDecimalSeparator);
         }
@@ -17,7 +17,7 @@ namespace System.Globalization.Tests
         [Theory]
         [InlineData("string")]
         [InlineData("    ")]
-        public void PercentDecimalSeparator_Set(string newPercentDecimalSeparator)
+        public void PercentDecimalSeparator_Set_GetReturnsExpected(string newPercentDecimalSeparator)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.PercentDecimalSeparator = newPercentDecimalSeparator;
@@ -25,10 +25,22 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void PercentDecimalSeparator_Set_Invalid()
+        public void PercentDecimalSeparator_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "PercentDecimalSeparator", () => format.PercentDecimalSeparator = null);
+        }
+
+        [Fact]
+        public void PercentDecimalSeparator_SetEmpty_ThrowsArgumentException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentException>("value", null, () => format.PercentDecimalSeparator = "");
+        }
+
+        [Fact]
+        public void PercentDecimalSeparator_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("PercentDecimalSeparator", () => new NumberFormatInfo().PercentDecimalSeparator = null);
-            AssertExtensions.Throws<ArgumentException>(null, () => new NumberFormatInfo().PercentDecimalSeparator = "");
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PercentDecimalSeparator = "string");
         }
     }
index 78fa49e..0a1b512 100644 (file)
@@ -9,7 +9,7 @@ namespace System.Globalization.Tests
     public class NumberFormatInfoPercentGroupSeparator
     {
         [Fact]
-        public void PercentGroupSeparator_Get_InvariantInfo()
+        public void PercentGroupSeparator_GetInvariantInfo_ReturnsExpected()
         {
             Assert.Equal(",", NumberFormatInfo.InvariantInfo.PercentGroupSeparator);
         }
@@ -18,7 +18,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("    ")]
         [InlineData("")]
-        public void PercentGroupSeparator_Set(string newPercentGroupSeparator)
+        public void PercentGroupSeparator_Set_GetReturnsExpected(string newPercentGroupSeparator)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.PercentGroupSeparator = newPercentGroupSeparator;
@@ -26,9 +26,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void PercentGroupSeparator_Set_Invalid()
+        public void PercentGroupSeparator_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "PercentGroupSeparator", () => format.PercentGroupSeparator = null);
+        }
+
+        [Fact]
+        public void PercentGroupSeparator_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("PercentGroupSeparator", () => new NumberFormatInfo().PercentGroupSeparator = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PercentGroupSeparator = "string");
         }
     }
index 8a03209..0c60309 100644 (file)
@@ -17,7 +17,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(PercentGroupSizes_TestData))]
-        public void PercentGroupSizes_Get(NumberFormatInfo format, int[] expected)
+        public void PercentGroupSizes_Get_ReturnsExpected(NumberFormatInfo format, int[] expected)
         {
             Assert.Equal(expected, format.PercentGroupSizes);
         }
@@ -27,7 +27,7 @@ namespace System.Globalization.Tests
         [InlineData(new int[] { 2, 3, 4 })]
         [InlineData(new int[] { 2, 3, 4, 0 })]
         [InlineData(new int[] { 0 })]
-        public void PercentGroupSizes_Set(int[] newPercentGroupSizes)
+        public void PercentGroupSizes_Set_GetReturnsExpected(int[] newPercentGroupSizes)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.PercentGroupSizes = newPercentGroupSizes;
@@ -35,14 +35,25 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void PercentGroupSizes_Set_Invalid()
+        public void PercentGroupSizes_SetNull_ThrowsArgumentNullException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("PercentGroupSizes", () => new NumberFormatInfo().PercentGroupSizes = null);
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "PercentGroupSizes", () => format.PercentGroupSizes = null);
+        }
 
-            AssertExtensions.Throws<ArgumentException>("PercentGroupSizes", () => new NumberFormatInfo().PercentGroupSizes = new int[] { -1, 1, 2 });
-            AssertExtensions.Throws<ArgumentException>("PercentGroupSizes", () => new NumberFormatInfo().PercentGroupSizes = new int[] { 98, 99, 100 });
-            AssertExtensions.Throws<ArgumentException>("PercentGroupSizes", () => new NumberFormatInfo().PercentGroupSizes = new int[] { 0, 1, 2 });
+        [Theory]
+        [InlineData(new int[] { -1, 1, 2 })]
+        [InlineData(new int[] { 98, 99, 100 })]
+        [InlineData(new int[] { 0, 1, 2 })]
+        public void PercentGroupSizes_SetInvalid_ThrowsArgumentException(int[] value)
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentException>("value", "PercentGroupSizes", () => format.PercentGroupSizes = value);
+        }
 
+        [Fact]
+        public void PercentGroupSizes_SetReadOnly_ThrowsInvalidOperationException()
+        {
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PercentGroupSizes = new int[] { 1, 2, 3 });
         }
     }
index bd1afeb..4738a6f 100644 (file)
@@ -26,13 +26,13 @@ namespace System.Globalization.Tests
         [Theory]
         [PlatformSpecific(TestPlatforms.AnyUnix)]
         [MemberData(nameof(PercentNegativePattern_TestData))]
-        public void PercentNegativePattern_Get(NumberFormatInfo format, int expected)
+        public void PercentNegativePattern_Get_ReturnsExpected(NumberFormatInfo format, int expected)
         {
             Assert.Equal(expected, format.PercentNegativePattern);
         }
 
         [Fact]
-        public void PercentNegativePattern_Invariant_Get()
+        public void PercentNegativePattern_GetInvariant_ReturnsExpected()
         {
             Assert.Equal(0, NumberFormatInfo.InvariantInfo.PercentNegativePattern);
         }
@@ -41,19 +41,25 @@ namespace System.Globalization.Tests
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(11)]
-        public void PercentNegativePattern_Set(int newPercentNegativePattern)
+        public void PercentNegativePattern_Set_GetReturnsExpected(int newPercentNegativePattern)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.PercentNegativePattern = newPercentNegativePattern;
             Assert.Equal(newPercentNegativePattern, format.PercentNegativePattern);
         }
 
-        [Fact]
-        public void PercentNegativePattern_Set_Invalid()
+        [Theory]
+        [InlineData(-1)]
+        [InlineData(12)]
+        public void PercentNegativePattern_SetInvalid_ThrowsArgumentOutOfRangeException(int value)
         {
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("PercentNegativePattern", () => new NumberFormatInfo().PercentNegativePattern = -1);
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("PercentNegativePattern", () => new NumberFormatInfo().PercentNegativePattern = 12);
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentOutOfRangeException>("value", "PercentNegativePattern", () => format.PercentNegativePattern = value);
+        }
 
+        [Fact]
+        public void PercentNegativePattern_SetReadOnly_ThrowsInvalidOperationException()
+        {
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PercentNegativePattern = 1);
         }
     }
index 5f595dc..6558f72 100644 (file)
@@ -26,13 +26,13 @@ namespace System.Globalization.Tests
         [Theory]
         [PlatformSpecific(TestPlatforms.AnyUnix)]
         [MemberData(nameof(PercentPositivePattern_TestData))]
-        public void PercentPositivePattern_Get(NumberFormatInfo format, int expected)
+        public void PercentPositivePattern_Get_ReturnsExpected(NumberFormatInfo format, int expected)
         {
             Assert.Equal(expected, format.PercentPositivePattern);
         }
 
         [Fact]
-        public void PercentPositivePattern_Invariant_Get()
+        public void PercentPositivePattern_GetInvariantInfo_ReturnsExpected()
         {
             Assert.Equal(0, NumberFormatInfo.InvariantInfo.PercentPositivePattern);
         }
@@ -41,19 +41,25 @@ namespace System.Globalization.Tests
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(3)]
-        public void PercentPositivePattern_Set(int newPercentPositivePattern)
+        public void PercentPositivePattern_Set_GetReturnsExpected(int newPercentPositivePattern)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.PercentPositivePattern = newPercentPositivePattern;
             Assert.Equal(newPercentPositivePattern, format.PercentPositivePattern);
         }
 
-        [Fact]
-        public void PercentPositivePattern_Set_Invalid()
+        [Theory]
+        [InlineData(-1)]
+        [InlineData(4)]
+        public void PercentPositivePattern_SetInvalid_ThrowsArgumentOutOfRangeException(int value)
         {
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("PercentPositivePattern", () => new NumberFormatInfo().PercentPositivePattern = -1);
-            AssertExtensions.Throws<ArgumentOutOfRangeException>("PercentPositivePattern", () => new NumberFormatInfo().PercentPositivePattern = 4);
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentOutOfRangeException>("value", "PercentPositivePattern", () => format.PercentPositivePattern = value);
+        }
 
+        [Fact]
+        public void PercentPositivePattern_SetReadOnly_ThrowsInvalidOperationException()
+        {
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PercentPositivePattern = 1);
         }
     }
index c13cdfd..b4bb565 100644 (file)
@@ -17,7 +17,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(PercentSymbol_TestData))]
-        public void PercentSymbol_Get(NumberFormatInfo format, string expected)
+        public void PercentSymbol_Get_ReturnsExpected(NumberFormatInfo format, string expected)
         {
             Assert.Equal(expected, format.PercentSymbol);
         }
@@ -26,7 +26,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("   ")]
         [InlineData("")]
-        public void PercentSymbol_Set(string newPercentSymbol)
+        public void PercentSymbol_Set_GetReturnsExpected(string newPercentSymbol)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.PercentSymbol = newPercentSymbol;
@@ -34,9 +34,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void PercentSymbol_Set_Invalid()
+        public void PercentSymbol_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "PercentSymbol", () => format.PercentSymbol = null);
+        }
+
+        [Fact]
+        public void PercentSymbol_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("PercentSymbol", () => new NumberFormatInfo().PercentSymbol = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PercentSymbol = "");
         }
     }
index 21f7a42..bd610aa 100644 (file)
@@ -18,7 +18,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(PositiveInfinitySymbol_TestData))]
-        public void PositiveInfinitySymbol_Get(NumberFormatInfo format)
+        public void PositiveInfinitySymbol_Get_ReturnsExpected(NumberFormatInfo format)
         {
             Assert.Equal(float.PositiveInfinity.ToString(format), format.PositiveInfinitySymbol);
         }
@@ -27,7 +27,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("   ")]
         [InlineData("")]
-        public void PositiveInfinitySymbol_Set(string newPositiveInfinitySymbol)
+        public void PositiveInfinitySymbol_Set_GetReturnsExpected(string newPositiveInfinitySymbol)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.PositiveInfinitySymbol = newPositiveInfinitySymbol;
@@ -35,9 +35,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void PositiveInfinitySymbol_Set_Invalid()
+        public void PositiveInfinitySymbol_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "PositiveInfinitySymbol", () => format.PositiveInfinitySymbol = null);
+        }
+
+        [Fact]
+        public void PositiveInfinitySymbol_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("PositiveInfinitySymbol", () => new NumberFormatInfo().PositiveInfinitySymbol = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PositiveInfinitySymbol = "");
         }
     }
index 92b8bf9..3846130 100644 (file)
@@ -17,7 +17,7 @@ namespace System.Globalization.Tests
 
         [Theory]
         [MemberData(nameof(PositiveSign_TestData))]
-        public void PositiveSign_Get(NumberFormatInfo format, string expected)
+        public void PositiveSign_Get_ReturnsExpected(NumberFormatInfo format, string expected)
         {
             Assert.Equal(expected, format.PositiveSign);
         }
@@ -26,7 +26,7 @@ namespace System.Globalization.Tests
         [InlineData("string")]
         [InlineData("   ")]
         [InlineData("")]
-        public void PositiveSign_Set(string newPositiveSign)
+        public void PositiveSign_Set_GetReturnsExpected(string newPositiveSign)
         {
             NumberFormatInfo format = new NumberFormatInfo();
             format.PositiveSign = newPositiveSign;
@@ -34,9 +34,15 @@ namespace System.Globalization.Tests
         }
 
         [Fact]
-        public void PositiveSign_Set_Invalid()
+        public void PositiveSign_SetNull_ThrowsArgumentNullException()
+        {
+            var format = new NumberFormatInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "PositiveSign", () => format.PositiveSign = null);
+        }
+
+        [Fact]
+        public void PositiveSign_SetReadOnly_ThrowsInvalidOperationException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("PositiveSign", () => new NumberFormatInfo().PositiveSign = null);
             Assert.Throws<InvalidOperationException>(() => NumberFormatInfo.InvariantInfo.PositiveSign = "");
         }
     }
index 3d92d66..56b9161 100644 (file)
@@ -10,7 +10,7 @@ namespace System.Globalization.Tests
     public class StringInfoCtorTests
     {
         [Fact]
-        public void Ctor_Empty()
+        public void Ctor_Default()
         {
             StringInfo stringInfo = new StringInfo();
             Assert.Equal(string.Empty, stringInfo.String);
@@ -41,9 +41,9 @@ namespace System.Globalization.Tests
         }
         
         [Fact]
-        public void Ctor_String_Null_ThrowsArgumentNullException()
+        public void Ctor_NullValue_ThrowsArgumentNullException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("String", () => new StringInfo(null));
+            AssertExtensions.Throws<ArgumentNullException>("value", "String", () => new StringInfo(null));
         }
     }
 }
index a71b1f6..085386c 100644 (file)
@@ -12,7 +12,7 @@ namespace System.Globalization.Tests
         [InlineData("")]
         [InlineData("abc")]
         [InlineData("\uD800\uDC00")]
-        public void String_Set(string value)
+        public void String_Set_GetReturnsExpected(string value)
         {
             StringInfo stringInfo = new StringInfo();
             stringInfo.String = value;
@@ -20,9 +20,10 @@ namespace System.Globalization.Tests
         }
         
         [Fact]
-        public void String_Set_Invalid()
+        public void String_SetNull_ThrowsArgumentNullException()
         {
-            AssertExtensions.Throws<ArgumentNullException>("String", () => new StringInfo().String = null);
+            var stringInfo = new StringInfo();
+            AssertExtensions.Throws<ArgumentNullException>("value", "String", () => stringInfo.String = null);
         }
     }
 }