diff options
176 files changed, 2410 insertions, 2410 deletions
diff --git a/src/Common/tests/System/Collections/DebugView.Tests.cs b/src/Common/tests/System/Collections/DebugView.Tests.cs index a52511b88f..a66d640930 100644 --- a/src/Common/tests/System/Collections/DebugView.Tests.cs +++ b/src/Common/tests/System/Collections/DebugView.Tests.cs @@ -34,7 +34,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("TestDebuggerAttributes_Inputs")] + [MemberData(nameof(TestDebuggerAttributes_Inputs))] public static void TestDebuggerAttributes(object obj) { DebuggerAttributes.ValidateDebuggerDisplayReferences(obj); @@ -42,7 +42,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("TestDebuggerAttributes_Inputs")] + [MemberData(nameof(TestDebuggerAttributes_Inputs))] public static void TestDebuggerAttributes_Null(object obj) { Type proxyType = DebuggerAttributes.GetProxyType(obj); diff --git a/src/Common/tests/System/Collections/IListTest.cs b/src/Common/tests/System/Collections/IListTest.cs index c84d1bf8f0..21652178f0 100644 --- a/src/Common/tests/System/Collections/IListTest.cs +++ b/src/Common/tests/System/Collections/IListTest.cs @@ -1584,7 +1584,7 @@ namespace Tests.Collections } [Theory] - [MemberData("RemoveAtInvalidData")] + [MemberData(nameof(RemoveAtInvalidData))] public void RemoveAtInvalid(int index, int size) { if (ExpectedIsFixedSize || ExpectedIsReadOnly) @@ -1599,7 +1599,7 @@ namespace Tests.Collections } [Theory] - [MemberData("RemoveAtInvalidData")] + [MemberData(nameof(RemoveAtInvalidData))] public void RemoveAtInvalidReadOnly(int index, int size) { if (!ExpectedIsFixedSize && !ExpectedIsReadOnly) diff --git a/src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.cs b/src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.cs index 9b1b96c4c0..817037d8c8 100644 --- a/src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.cs +++ b/src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.cs @@ -22,168 +22,168 @@ namespace System.Security.Cryptography.EcDsa.Tests }; } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataByteArray_NullData_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>("data", () => ecdsa.SignData((byte[])null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataByteArray_DefaultHashAlgorithm_ThrowsArgumentException(ECDsa ecdsa) { Assert.Throws<ArgumentException>("hashAlgorithm", () => ecdsa.SignData(new byte[0], default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataByteArraySpan_NullData_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>("data", () => ecdsa.SignData(null, -1, -1, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataByteArraySpan_NegativeOffset_ThrowsArgumentOutOfRangeException(ECDsa ecdsa) { Assert.Throws<ArgumentOutOfRangeException>("offset", () => ecdsa.SignData(new byte[0], -1, -1, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataByteArraySpan_OffsetGreaterThanCount_ThrowsArgumentOutOfRangeException(ECDsa ecdsa) { Assert.Throws<ArgumentOutOfRangeException>("offset", () => ecdsa.SignData(new byte[0], 2, 1, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataByteArraySpan_NegativeCount_ThrowsArgumentOutOfRangeException(ECDsa ecdsa) { Assert.Throws<ArgumentOutOfRangeException>("count", () => ecdsa.SignData(new byte[0], 0, -1, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataByteArraySpan_CountGreaterThanLengthMinusOffset_ThrowsArgumentOutOfRangeException(ECDsa ecdsa) { Assert.Throws<ArgumentOutOfRangeException>("count", () => ecdsa.SignData(new byte[0], 0, 1, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataByteArraySpan_DefaultHashAlgorithm_ThrowsArgumentException(ECDsa ecdsa) { Assert.Throws<ArgumentException>("hashAlgorithm", () => ecdsa.SignData(new byte[0], 0, 0, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataByteArraySpan_EmptyHashAlgorithm_ThrowsArgumentException(ECDsa ecdsa) { Assert.Throws<ArgumentException>("hashAlgorithm", () => ecdsa.SignData(new byte[10], 0, 10, new HashAlgorithmName(""))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataStream_NullData_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>("data", () => ecdsa.SignData((Stream)null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void SignDataStream_DefaultHashAlgorithm_ThrowsArgumentException(ECDsa ecdsa) { Assert.Throws<ArgumentException>("hashAlgorithm", () => ecdsa.SignData(new MemoryStream(), default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataByteArray_NullData_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>("data", () => ecdsa.VerifyData((byte[])null, null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataByteArray_NullSignature_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>("signature", () => ecdsa.VerifyData(new byte[0], null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataByteArray_DefaultHashAlgorithm_ThrowsArgumentException(ECDsa ecdsa) { Assert.Throws<ArgumentException>("hashAlgorithm", () => ecdsa.VerifyData(new byte[0], new byte[0], default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataByteArraySpan_NullData_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>("data", () => ecdsa.VerifyData((byte[])null, -1, -1, null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataByteArraySpan_NegativeOffset_ThrowsArgumentOutOfRangeException(ECDsa ecdsa) { Assert.Throws<ArgumentOutOfRangeException>("offset", () => ecdsa.VerifyData(new byte[0], -1, -1, null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataByteArraySpan_OffsetGreaterThanCount_ThrowsArgumentOutOfRangeException(ECDsa ecdsa) { Assert.Throws<ArgumentOutOfRangeException>("offset", () => ecdsa.VerifyData(new byte[0], 2, 1, null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataByteArraySpan_NegativeCount_ThrowsArgumentOutOfRangeException(ECDsa ecdsa) { Assert.Throws<ArgumentOutOfRangeException>("count", () => ecdsa.VerifyData(new byte[0], 0, -1, null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataByteArraySpan_CountGreaterThanLengthMinusOffset_ThrowsArgumentOutOfRangeException(ECDsa ecdsa) { Assert.Throws<ArgumentOutOfRangeException>("count", () => ecdsa.VerifyData(new byte[0], 0, 1, null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataByteArraySpan_NullSignature_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>("signature", () => ecdsa.VerifyData(new byte[0], 0, 0, null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataByteArraySpan_EmptyHashAlgorithm_ThrowsArgumentException(ECDsa ecdsa) { Assert.Throws<ArgumentException>("hashAlgorithm", () => ecdsa.VerifyData(new byte[10], 0, 10, new byte[0], new HashAlgorithmName(""))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataStream_NullData_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>("data", () => ecdsa.VerifyData((Stream)null, null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataStream_NullSignature_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>("signature", () => ecdsa.VerifyData(new MemoryStream(), null, default(HashAlgorithmName))); } - [Theory, MemberData("AllImplementations")] + [Theory, MemberData(nameof(AllImplementations))] public void VerifyDataStream_DefaultHashAlgorithm_ThrowsArgumentException(ECDsa ecdsa) { Assert.Throws<ArgumentException>("hashAlgorithm", @@ -200,7 +200,7 @@ namespace System.Security.Cryptography.EcDsa.Tests }; } - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void SignHash_NullHash_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>( @@ -208,7 +208,7 @@ namespace System.Security.Cryptography.EcDsa.Tests () => ecdsa.SignHash(null)); } - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void VerifyHash_NullHash_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>( @@ -216,7 +216,7 @@ namespace System.Security.Cryptography.EcDsa.Tests () => ecdsa.VerifyHash(null, null)); } - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void VerifyHash_NullSignature_ThrowsArgumentNullException(ECDsa ecdsa) { Assert.Throws<ArgumentNullException>( @@ -226,42 +226,42 @@ namespace System.Security.Cryptography.EcDsa.Tests ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void SignDataByteArray_UnsupportedHashAlgorithm_ThrowsCryptographicException(ECDsa ecdsa) { Assert.Throws<CryptographicException>( () => ecdsa.SignData(new byte[0], new HashAlgorithmName("NOT_A_REAL_HASH_ALGORITHM"))); } - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void SignDataByteArraySpan_UnsupportedHashAlgorithm_ThrowsCryptographicException(ECDsa ecdsa) { Assert.Throws<CryptographicException>( () => ecdsa.SignData(new byte[0], 0, 0, new HashAlgorithmName("NOT_A_REAL_HASH_ALGORITHM"))); } - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void SignDataStream_UnsupportedHashAlgorithm_ThrowsCryptographicException(ECDsa ecdsa) { Assert.Throws<CryptographicException>( () => ecdsa.SignData(new MemoryStream(), new HashAlgorithmName("NOT_A_REAL_HASH_ALGORITHM"))); } - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void VerifyDataByteArray_UnsupportedHashAlgorithm_ThrowsCryptographicException(ECDsa ecdsa) { Assert.Throws<CryptographicException>( () => ecdsa.VerifyData(new byte[0], new byte[0], new HashAlgorithmName("NOT_A_REAL_HASH_ALGORITHM"))); } - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void VerifyDataByteArraySpan_UnsupportedHashAlgorithm_ThrowsCryptographicException(ECDsa ecdsa) { Assert.Throws<CryptographicException>( () => ecdsa.VerifyData(new byte[0], 0, 0, new byte[0], new HashAlgorithmName("NOT_A_REAL_HASH_ALGORITHM"))); } - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void VerifyDataStream_UnsupportedHashAlgorithm_ThrowsCryptographicException(ECDsa ecdsa) { Assert.Throws<CryptographicException>( @@ -270,7 +270,7 @@ namespace System.Security.Cryptography.EcDsa.Tests ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void SignData_MaxOffset_ZeroLength_NoThrow(ECDsa ecdsa) { // Explicitly larger than Array.Empty @@ -280,7 +280,7 @@ namespace System.Security.Cryptography.EcDsa.Tests Assert.True(ecdsa.VerifyData(Array.Empty<byte>(), signature, HashAlgorithmName.SHA256)); } - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void VerifyData_MaxOffset_ZeroLength_NoThrow(ECDsa ecdsa) { // Explicitly larger than Array.Empty @@ -290,7 +290,7 @@ namespace System.Security.Cryptography.EcDsa.Tests Assert.True(ecdsa.VerifyData(data, data.Length, 0, signature, HashAlgorithmName.SHA256)); } - [Theory, MemberData("RealImplementations")] + [Theory, MemberData(nameof(RealImplementations))] public void Roundtrip_WithOffset(ECDsa ecdsa) { byte[] data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; @@ -337,7 +337,7 @@ namespace System.Security.Cryptography.EcDsa.Tests } } - [Theory, MemberData("InteroperableSignatureConfigurations")] + [Theory, MemberData(nameof(InteroperableSignatureConfigurations))] public void SignVerify_InteroperableSameKeys_RoundTripsUnlessTampered(ECDsa ecdsa, HashAlgorithmName hashAlgorithm) { byte[] data = Encoding.UTF8.GetBytes("something to repeat and sign"); diff --git a/src/Microsoft.Win32.Registry/tests/Registry/Registry_Getvalue_str_str_obj.cs b/src/Microsoft.Win32.Registry/tests/Registry/Registry_Getvalue_str_str_obj.cs index 7d45874341..497c3de7b8 100644 --- a/src/Microsoft.Win32.Registry/tests/Registry/Registry_Getvalue_str_str_obj.cs +++ b/src/Microsoft.Win32.Registry/tests/Registry/Registry_Getvalue_str_str_obj.cs @@ -38,7 +38,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestValueTypes { get { return TestData.TestValueTypes; } } [Theory] - [MemberData("TestValueTypes")] + [MemberData(nameof(TestValueTypes))] public void TestGetValueWithValueTypes(string valueName, object testValue) { TestRegistryKey.SetValue(valueName, testValue); @@ -70,7 +70,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestRegistryKeys")] + [MemberData(nameof(TestRegistryKeys))] public static void GetValueFromDifferentKeys(RegistryKey key, string valueName, bool useSeparator) { const int expectedValue = 11; @@ -94,7 +94,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestRegistryKeys")] + [MemberData(nameof(TestRegistryKeys))] public static void GetDefaultValueFromDifferentKeys(RegistryKey key, string valueName, bool useSeparator) { // We ignore valueName because we test against default value diff --git a/src/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj.cs b/src/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj.cs index b7fd00ee4a..e578d33ffa 100644 --- a/src/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj.cs +++ b/src/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj.cs @@ -50,7 +50,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestValueTypes { get { return TestData.TestValueTypes; } } [Theory] - [MemberData("TestValueTypes")] + [MemberData(nameof(TestValueTypes))] public void SetValueWithValueTypes(string valueName, object testValue) { Registry.SetValue(TestRegistryKey.Name, valueName, testValue); @@ -113,7 +113,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestEnvironment { get { return TestData.TestEnvironment; } } [Theory] - [MemberData("TestEnvironment")] + [MemberData(nameof(TestEnvironment))] public void SetValueWithEnvironmentVariable(string valueName, string envVariableName, string expectedVariableValue) { string value = "%" + envVariableName + "%"; diff --git a/src/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj_valuekind.cs b/src/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj_valuekind.cs index d8a992729e..db20faa609 100644 --- a/src/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj_valuekind.cs +++ b/src/Microsoft.Win32.Registry/tests/Registry/Registry_SetValue_str_str_obj_valuekind.cs @@ -13,7 +13,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestObjects { get { return TestData.TestObjects; } } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithUnknownValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { string valueName = "Testing_" + testIndex.ToString(); @@ -25,7 +25,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithStringValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { string valueName = "Testing_" + testIndex.ToString(); @@ -38,7 +38,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithExpandStringValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { string valueName = "Testing_" + testIndex.ToString(); @@ -51,7 +51,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithMultiStringValeKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { try @@ -71,7 +71,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithBinaryValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { try @@ -91,7 +91,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithDWordValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { try @@ -112,7 +112,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithQWordValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { try @@ -155,7 +155,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestValueNames { get { return TestData.TestValueNames; } } [Theory] - [MemberData("TestValueNames")] + [MemberData(nameof(TestValueNames))] public void SetValueWithNameTest(string valueName) { const long expectedValue = long.MaxValue; diff --git a/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str.cs b/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str.cs index ba2e79a390..5258c46459 100644 --- a/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str.cs +++ b/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str.cs @@ -42,7 +42,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestValueTypes { get { return TestData.TestValueTypes; } } [Theory] - [MemberData("TestValueTypes")] + [MemberData(nameof(TestValueTypes))] public void TestGetValueWithValueTypes(string valueName, object testValue) { TestRegistryKey.SetValue(valueName, testValue); diff --git a/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str_obj.cs b/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str_obj.cs index 108e269f1e..5482855924 100644 --- a/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str_obj.cs +++ b/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str_obj.cs @@ -43,7 +43,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestValueTypes { get { return TestData.TestValueTypes; } } [Theory] - [MemberData("TestValueTypes")] + [MemberData(nameof(TestValueTypes))] public void TestGetValueWithValueTypes(string valueName, object testValue) { TestRegistryKey.SetValue(valueName, testValue); diff --git a/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str_obj_b.cs b/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str_obj_b.cs index 8c1812d960..571e11243d 100644 --- a/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str_obj_b.cs +++ b/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str_obj_b.cs @@ -58,7 +58,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestExpandableStrings { get { return TestData.TestExpandableStrings; } } [Theory] - [MemberData("TestExpandableStrings")] + [MemberData(nameof(TestExpandableStrings))] public void GetExpandableStringValueWithNoneOption(string testValue, string expectedValue) { // [] Make sure NoExpand = false works with some valid values. @@ -87,7 +87,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestValueTypes { get { return TestData.TestValueTypes; } } [Theory] - [MemberData("TestValueTypes")] + [MemberData(nameof(TestValueTypes))] public void GetValueWithValueTypes(string valueName, object testValue) { TestRegistryKey.SetValue(valueName, testValue, RegistryValueKind.ExpandString); @@ -96,7 +96,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestExpandableStrings")] + [MemberData(nameof(TestExpandableStrings))] public void GetExpandableStringValueWithDoNotExpandOption(string testValue, string expectedValue) { const string valueName = "MyTestKey"; @@ -108,7 +108,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestEnvironment { get { return TestData.TestEnvironment; } } [Theory] - [MemberData("TestEnvironment")] + [MemberData(nameof(TestEnvironment))] public void GetValueWithEnvironmentVariable(string valueName, string envVariableName, string expectedVariableValue) { TestRegistryKey.SetValue(valueName, expectedVariableValue, RegistryValueKind.ExpandString); diff --git a/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValueKind_str_obj_valueKind.cs b/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValueKind_str_obj_valueKind.cs index b5dbc38dd2..2a86386e80 100644 --- a/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValueKind_str_obj_valueKind.cs +++ b/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValueKind_str_obj_valueKind.cs @@ -13,7 +13,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestObjects { get { return TestData.TestObjects; } } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithUnknownValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { string valueName = "Testing_" + testIndex.ToString(); @@ -25,7 +25,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithStringValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { string valueName = "Testing_" + testIndex.ToString(); @@ -38,7 +38,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithExpandStringValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { string valueName = "Testing_" + testIndex.ToString(); @@ -51,7 +51,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithMultiStringValeKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { try @@ -71,7 +71,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithBinaryValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { try @@ -91,7 +91,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithDWordValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { try @@ -112,7 +112,7 @@ namespace Microsoft.Win32.RegistryTests } [Theory] - [MemberData("TestObjects")] + [MemberData(nameof(TestObjects))] public void SetValueWithQWordValueKind(int testIndex, object testValue, RegistryValueKind expectedValueKind) { try @@ -155,7 +155,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestValueNames { get { return TestData.TestValueNames; } } [Theory] - [MemberData("TestValueNames")] + [MemberData(nameof(TestValueNames))] public void SetValueWithNameTest(string valueName) { const long expectedValue = long.MaxValue; diff --git a/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValue_str_obj.cs b/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValue_str_obj.cs index 99d5b5dfc1..158cafb43f 100644 --- a/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValue_str_obj.cs +++ b/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_SetValue_str_obj.cs @@ -48,7 +48,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestValueTypes { get { return TestData.TestValueTypes; } } [Theory] - [MemberData("TestValueTypes")] + [MemberData(nameof(TestValueTypes))] public void SetValueWithValueTypes(string valueName, object testValue) { TestRegistryKey.SetValue(valueName, testValue); @@ -111,7 +111,7 @@ namespace Microsoft.Win32.RegistryTests public static IEnumerable<object[]> TestEnvironment { get { return TestData.TestEnvironment; } } [Theory] - [MemberData("TestEnvironment")] + [MemberData(nameof(TestEnvironment))] public void SetValueWithEnvironmentVariable(string valueName, string envVariableName, string expectedVariableValue) { string value = "%" + envVariableName + "%"; diff --git a/src/System.Collections.Specialized/tests/BitVector32Tests.cs b/src/System.Collections.Specialized/tests/BitVector32Tests.cs index ad2c1b8755..62788c7132 100644 --- a/src/System.Collections.Specialized/tests/BitVector32Tests.cs +++ b/src/System.Collections.Specialized/tests/BitVector32Tests.cs @@ -300,7 +300,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("Mask_SetUnset_Multiple_Data")] + [MemberData(nameof(Mask_SetUnset_Multiple_Data))] public static void Set_Mask_MultipleTest(int expected, int start, int[] maskPositions) { int mask = maskPositions.Sum(x => 1 << (x - 1)); @@ -322,7 +322,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("Mask_SetUnset_Multiple_Data")] + [MemberData(nameof(Mask_SetUnset_Multiple_Data))] public static void Set_Mask_Multiple_UnsetTest(int start, int expected, int[] maskPositions) { int mask = maskPositions.Sum(x => 1 << (x - 1)); @@ -341,7 +341,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("Section_Set_Data")] + [MemberData(nameof(Section_Set_Data))] public static void Set_SectionTest(int value, BitVector32.Section section) { BitVector32 empty = new BitVector32(); @@ -418,7 +418,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("Section_Create_Data")] + [MemberData(nameof(Section_Create_Data))] public static void CreateSectionTest(short maximum, short mask) { BitVector32.Section section = BitVector32.CreateSection(maximum); @@ -427,7 +427,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("Section_Create_Data")] + [MemberData(nameof(Section_Create_Data))] public static void CreateSection_NextTest(short maximum, short mask) { BitVector32.Section initial = BitVector32.CreateSection(short.MaxValue); @@ -468,7 +468,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("Section_Equal_Data")] + [MemberData(nameof(Section_Equal_Data))] public static void Section_EqualsTest(BitVector32.Section left, BitVector32.Section right) { Assert.True(left.Equals(left)); @@ -485,7 +485,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("Section_Unequal_Data")] + [MemberData(nameof(Section_Unequal_Data))] public static void Section_Unequal_EqualsTest(BitVector32.Section left, BitVector32.Section right) { Assert.False(left.Equals(right)); @@ -501,7 +501,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("Section_Equal_Data")] + [MemberData(nameof(Section_Equal_Data))] public static void Section_GetHashCodeTest(BitVector32.Section left, BitVector32.Section right) { Assert.Equal(left.GetHashCode(), left.GetHashCode()); diff --git a/src/System.Collections.Specialized/tests/ListDictionaryTests.cs b/src/System.Collections.Specialized/tests/ListDictionaryTests.cs index f499d3e5a8..381f36c1d3 100644 --- a/src/System.Collections.Specialized/tests/ListDictionaryTests.cs +++ b/src/System.Collections.Specialized/tests/ListDictionaryTests.cs @@ -60,7 +60,7 @@ namespace System.Collections.Specialized.Tests }; [Theory] - [MemberData("ListDictionary_Empty_Data")] + [MemberData(nameof(ListDictionary_Empty_Data))] public static void Constructor_DefaultTests(ListDictionary ld) { Assert.Equal(0, ld.Count); @@ -157,7 +157,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void Add_NullKeyTest(ListDictionary ld, KeyValuePair<string, string>[] data) { Assert.Throws<ArgumentNullException>("key", () => ld.Add(null, "value")); @@ -165,7 +165,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void ClearTest(ListDictionary ld, KeyValuePair<string, string>[] data) { Assert.Equal(data.Length, ld.Count); @@ -178,14 +178,14 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void Contains_NullTest(ListDictionary ld, KeyValuePair<string, string>[] data) { Assert.Throws<ArgumentNullException>("key", () => ld.Contains(null)); } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void CopyToTest(ListDictionary ld, KeyValuePair<string, string>[] data) { DictionaryEntry[] translated = data.Select(kv => new DictionaryEntry(kv.Key, kv.Value)).ToArray(); @@ -212,7 +212,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void CopyTo_ArgumentInvalidTest(ListDictionary ld, KeyValuePair<string, string>[] data) { Assert.Throws<ArgumentNullException>("array", () => ld.CopyTo(null, 0)); @@ -227,7 +227,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void GetSetTest(ListDictionary ld, KeyValuePair<string, string>[] data) { DictionaryEntry[] translated = data.Select(kv => new DictionaryEntry(kv.Key, kv.Value)).ToArray(); @@ -268,7 +268,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void GetSet_ArgumentInvalidTest(ListDictionary ld, KeyValuePair<string, string>[] data) { Assert.Throws<ArgumentNullException>("key", () => ld[(string)null] = "notpresent"); @@ -294,7 +294,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void GetEnumeratorTest(ListDictionary ld, KeyValuePair<string, string>[] data) { bool repeat = true; @@ -324,7 +324,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void GetEnumerator_ModifiedCollectionTest(ListDictionary ld, KeyValuePair<string, string>[] data) { IDictionaryEnumerator enumerator = ld.GetEnumerator(); @@ -346,7 +346,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void RemoveTest(ListDictionary ld, KeyValuePair<string, string>[] data) { Assert.All(data, element => @@ -376,7 +376,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void Remove_NotPresentTest(ListDictionary ld, KeyValuePair<string, string>[] data) { ld.Remove("notpresent"); @@ -385,7 +385,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void SyncRootTest(ListDictionary ld, KeyValuePair<string, string>[] data) { object syncRoot = ld.SyncRoot; @@ -400,7 +400,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void KeyCollection_CopyTo_NullArgument_Test(ListDictionary ld, KeyValuePair<string, string>[] data) { ICollection keys = ld.Keys; @@ -408,7 +408,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void KeyCollection_CopyTo_InvalidArgument_Test(ListDictionary ld, KeyValuePair<string, string>[] data) { ICollection keys = ld.Keys; @@ -416,7 +416,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void KeyCollection_SyncRoot_Test(ListDictionary ld, KeyValuePair<string, string>[] data) { ICollection keys = ld.Keys; @@ -431,7 +431,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void KeyCollection_GetEnumeratorTest(ListDictionary ld, KeyValuePair<string, string>[] data) { bool repeat = true; @@ -456,7 +456,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("ListDictionary_Data")] + [MemberData(nameof(ListDictionary_Data))] public static void KeyCollection_GetEnumerator_ModifiedCollectionTest(ListDictionary ld, KeyValuePair<string, string>[] data) { IEnumerator enumerator = ld.Keys.GetEnumerator(); diff --git a/src/System.Collections.Specialized/tests/StringCollectionTests.cs b/src/System.Collections.Specialized/tests/StringCollectionTests.cs index dfb0934e08..fa63185207 100644 --- a/src/System.Collections.Specialized/tests/StringCollectionTests.cs +++ b/src/System.Collections.Specialized/tests/StringCollectionTests.cs @@ -114,8 +114,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void AddTest(StringCollection collection, string[] data) { StringCollection added = new StringCollection(); @@ -131,8 +131,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void Add_ExplicitInterface_Test(StringCollection collection, string[] data) { IList added = new StringCollection(); @@ -148,8 +148,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void AddRangeTest(StringCollection collection, string[] data) { StringCollection added = new StringCollection(); @@ -160,16 +160,16 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void AddRange_NullTest(StringCollection collection, string[] data) { Assert.Throws<ArgumentNullException>("value", () => collection.AddRange(null)); } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void ClearTest(StringCollection collection, string[] data) { Assert.Equal(data.Length, collection.Count); @@ -178,8 +178,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void CopyToTest(StringCollection collection, string[] data) { string[] full = new string[data.Length]; @@ -202,8 +202,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void CopyTo_ExplicitInterface_Test(ICollection collection, string[] data) { string[] full = new string[data.Length]; @@ -226,8 +226,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void CopyTo_ArgumentInvalidTest(StringCollection collection, string[] data) { Assert.Throws<ArgumentNullException>(() => collection.CopyTo(null, 0)); @@ -249,8 +249,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void CountTest(StringCollection collection, string[] data) { Assert.Equal(data.Length, collection.Count); @@ -263,8 +263,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void ContainsTest(StringCollection collection, string[] data) { Assert.All(data, element => Assert.True(collection.Contains(element))); @@ -274,8 +274,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void GetEnumeratorTest(StringCollection collection, string[] data) { bool repeat = true; @@ -301,8 +301,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void GetEnumerator_ModifiedCollectionTest(StringCollection collection, string[] data) { StringEnumerator enumerator = collection.GetEnumerator(); @@ -329,8 +329,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void GetSetTest(StringCollection collection, string[] data) { for (int i = 0; i < data.Length; i++) @@ -350,8 +350,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void GetSet_ExplicitInterface_Test(IList collection, string[] data) { for (int i = 0; i < data.Length; i++) @@ -375,8 +375,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void GetSet_ArgumentInvalidTest(StringCollection collection, string[] data) { Assert.Throws<ArgumentOutOfRangeException>(() => collection[-1] = ElementNotPresent); @@ -398,8 +398,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void IndexOfTest(StringCollection collection, string[] data) { Assert.All(data, element => Assert.Equal(Array.IndexOf(data, element), collection.IndexOf(element))); @@ -409,7 +409,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void IndexOf_DuplicateTest(StringCollection collection, string[] data) { // Only the index of the first element will be returned. @@ -421,7 +421,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("Insert_Data")] + [MemberData(nameof(Insert_Data))] public static void InsertTest(StringCollection collection, string[] data, string element, int location) { collection.Insert(location, element); @@ -448,7 +448,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("Insert_Data")] + [MemberData(nameof(Insert_Data))] public static void Insert_ExplicitInterface_Test(IList collection, string[] data, string element, int location) { collection.Insert(location, element); @@ -475,8 +475,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void Insert_ArgumentInvalidTest(StringCollection collection, string[] data) { Assert.Throws<ArgumentOutOfRangeException>(() => collection.Insert(-1, ElementNotPresent)); @@ -508,7 +508,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] + [MemberData(nameof(StringCollection_Data))] public static void RemoveTest(StringCollection collection, string[] data) { Assert.All(data, element => @@ -523,7 +523,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] + [MemberData(nameof(StringCollection_Data))] public static void Remove_IListTest(StringCollection collection, string[] data) { Assert.All(data, element => @@ -538,8 +538,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void Remove_NotPresentTest(StringCollection collection, string[] data) { collection.Remove(ElementNotPresent); @@ -549,7 +549,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void Remove_DuplicateTest(StringCollection collection, string[] data) { // Only the first element will be removed. @@ -577,7 +577,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("RemoveAt_Data")] + [MemberData(nameof(RemoveAt_Data))] public static void RemoveAtTest(StringCollection collection, string[] data, int location) { collection.RemoveAt(location); @@ -596,8 +596,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void RemoveAt_ArgumentInvalidTest(StringCollection collection, string[] data) { Assert.Throws<ArgumentOutOfRangeException>(() => collection.RemoveAt(-1)); @@ -605,7 +605,7 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void Remove_Duplicate_IListTest(StringCollection collection, string[] data) { // Only the first element will be removed. @@ -633,8 +633,8 @@ namespace System.Collections.Specialized.Tests } [Theory] - [MemberData("StringCollection_Data")] - [MemberData("StringCollection_Duplicates_Data")] + [MemberData(nameof(StringCollection_Data))] + [MemberData(nameof(StringCollection_Duplicates_Data))] public static void SyncRootTest(StringCollection collection, string[] data) { object syncRoot = collection.SyncRoot; diff --git a/src/System.Collections/tests/Generic/List/List.Generic.Tests.AddRange.cs b/src/System.Collections/tests/Generic/List/List.Generic.Tests.AddRange.cs index 7d04a6163f..cc6780c246 100644 --- a/src/System.Collections/tests/Generic/List/List.Generic.Tests.AddRange.cs +++ b/src/System.Collections/tests/Generic/List/List.Generic.Tests.AddRange.cs @@ -17,7 +17,7 @@ namespace System.Collections.Tests // Has tests that pass a variably sized TestCollection and MyEnumerable to the AddRange function [Theory] - [MemberData("EnumerableTestData")] + [MemberData(nameof(EnumerableTestData))] public void AddRange(EnumerableType enumerableType, int listLength, int enumerableLength, int numberOfMatchingElements, int numberOfDuplicateElements) { List<T> list = GenericListFactory(listLength); @@ -39,7 +39,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void AddRange_NullEnumerable_ThrowsArgumentNullException(int count) { List<T> list = GenericListFactory(count); diff --git a/src/System.Collections/tests/Generic/List/List.Generic.Tests.BinarySearch.cs b/src/System.Collections/tests/Generic/List/List.Generic.Tests.BinarySearch.cs index 77be14d409..256696dd8b 100644 --- a/src/System.Collections/tests/Generic/List/List.Generic.Tests.BinarySearch.cs +++ b/src/System.Collections/tests/Generic/List/List.Generic.Tests.BinarySearch.cs @@ -15,7 +15,7 @@ namespace System.Collections.Tests public abstract partial class List_Generic_Tests<T> : IList_Generic_Tests<T> { [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void BinarySearch_ForEveryItemWithoutDuplicates(int count) { List<T> list = GenericListFactory(count); @@ -34,7 +34,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void BinarySearch_ForEveryItemWithDuplicates(int count) { if (count > 0) @@ -54,7 +54,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void BinarySearch_Validations(int count) { List<T> list = GenericListFactory(count); diff --git a/src/System.Collections/tests/Generic/List/List.Generic.Tests.Constructor.cs b/src/System.Collections/tests/Generic/List/List.Generic.Tests.Constructor.cs index 5e983bfe30..f24d75866f 100644 --- a/src/System.Collections/tests/Generic/List/List.Generic.Tests.Constructor.cs +++ b/src/System.Collections/tests/Generic/List/List.Generic.Tests.Constructor.cs @@ -47,7 +47,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("EnumerableTestData")] + [MemberData(nameof(EnumerableTestData))] public void Constructor_IEnumerable(EnumerableType enumerableType, int listLength, int enumerableLength, int numberOfMatchingElements, int numberOfDuplicateElements) { IEnumerable<T> enumerable = CreateEnumerable(enumerableType, null, enumerableLength, 0, numberOfDuplicateElements); diff --git a/src/System.Collections/tests/Generic/List/List.Generic.Tests.IndexOf.cs b/src/System.Collections/tests/Generic/List/List.Generic.Tests.IndexOf.cs index 12e31e8309..977d57f67e 100644 --- a/src/System.Collections/tests/Generic/List/List.Generic.Tests.IndexOf.cs +++ b/src/System.Collections/tests/Generic/List/List.Generic.Tests.IndexOf.cs @@ -77,7 +77,7 @@ namespace System.Collections.Tests #region IndexOf [Theory] - [MemberData("IndexOfTestData")] + [MemberData(nameof(IndexOfTestData))] public void IndexOf_NoDuplicates(IndexOfMethod indexOfMethod, int count, bool frontToBackOrder) { List<T> list = GenericListFactory(count); @@ -91,7 +91,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("IndexOfTestData")] + [MemberData(nameof(IndexOfTestData))] public void IndexOf_NonExistingValues(IndexOfMethod indexOfMethod, int count, bool frontToBackOrder) { List<T> list = GenericListFactory(count); @@ -105,7 +105,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("IndexOfTestData")] + [MemberData(nameof(IndexOfTestData))] public void IndexOf_DefaultValue(IndexOfMethod indexOfMethod, int count, bool frontToBackOrder) { T defaultValue = default(T); @@ -118,7 +118,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("IndexOfTestData")] + [MemberData(nameof(IndexOfTestData))] public void IndexOf_OrderIsCorrect(IndexOfMethod indexOfMethod, int count, bool frontToBackOrder) { List<T> list = GenericListFactory(count); @@ -136,7 +136,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void IndexOf_int_OrderIsCorrectWithManyDuplicates(int count) { List<T> list = GenericListFactory(count); @@ -157,7 +157,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void LastIndexOf_int_OrderIsCorrectWithManyDuplicates(int count) { List<T> list = GenericListFactory(count); @@ -178,7 +178,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void IndexOf_int_OutOfRangeExceptions(int count) { List<T> list = GenericListFactory(count); @@ -190,7 +190,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void IndexOf_int_int_OutOfRangeExceptions(int count) { List<T> list = GenericListFactory(count); @@ -205,7 +205,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void LastIndexOf_int_OutOfRangeExceptions(int count) { List<T> list = GenericListFactory(count); @@ -218,7 +218,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void LastIndexOf_int_int_OutOfRangeExceptions(int count) { List<T> list = GenericListFactory(count); diff --git a/src/System.Collections/tests/Generic/List/List.Generic.Tests.Remove.cs b/src/System.Collections/tests/Generic/List/List.Generic.Tests.Remove.cs index df3444049f..3d7ed8d54c 100644 --- a/src/System.Collections/tests/Generic/List/List.Generic.Tests.Remove.cs +++ b/src/System.Collections/tests/Generic/List/List.Generic.Tests.Remove.cs @@ -17,7 +17,7 @@ namespace System.Collections.Tests #region RemoveAll(Pred<T>) [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void RemoveAll_AllElements(int count) { List<T> list = GenericListFactory(count); @@ -28,7 +28,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void RemoveAll_NoElements(int count) { List<T> list = GenericListFactory(count); @@ -40,7 +40,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void RemoveAll_DefaultElements(int count) { List<T> list = GenericListFactory(count); @@ -84,7 +84,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void RemoveRange_InvalidParameters(int listLength) { if (listLength % 2 != 0) @@ -116,7 +116,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void RemoveRange_NegativeParameters(int listLength) { if (listLength % 2 != 0) diff --git a/src/System.Collections/tests/Generic/List/List.Generic.Tests.Reverse.cs b/src/System.Collections/tests/Generic/List/List.Generic.Tests.Reverse.cs index 604667f616..b64c585d5e 100644 --- a/src/System.Collections/tests/Generic/List/List.Generic.Tests.Reverse.cs +++ b/src/System.Collections/tests/Generic/List/List.Generic.Tests.Reverse.cs @@ -15,7 +15,7 @@ namespace System.Collections.Tests public abstract partial class List_Generic_Tests<T> : IList_Generic_Tests<T> { [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void Reverse(int listLength) { List<T> list = GenericListFactory(listLength); @@ -103,7 +103,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void Reverse_InvalidParameters(int listLength) { if (listLength % 2 != 0) @@ -135,7 +135,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void Reverse_NegativeParameters(int listLength) { if (listLength % 2 != 0) diff --git a/src/System.Collections/tests/Generic/List/List.Generic.Tests.Sort.cs b/src/System.Collections/tests/Generic/List/List.Generic.Tests.Sort.cs index 56f9859a88..4f2dba9e01 100644 --- a/src/System.Collections/tests/Generic/List/List.Generic.Tests.Sort.cs +++ b/src/System.Collections/tests/Generic/List/List.Generic.Tests.Sort.cs @@ -22,7 +22,7 @@ namespace System.Collections.Tests #region Sort [Theory] - [MemberData("ValidCollectionSizes_GreaterThanOne")] + [MemberData(nameof(ValidCollectionSizes_GreaterThanOne))] public void Sort_WithoutDuplicates(int count) { List<T> list = GenericListFactory(count); @@ -35,7 +35,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes_GreaterThanOne")] + [MemberData(nameof(ValidCollectionSizes_GreaterThanOne))] public void Sort_WithDuplicates(int count) { List<T> list = GenericListFactory(count); @@ -53,7 +53,7 @@ namespace System.Collections.Tests #region Sort(IComparer) [Theory] - [MemberData("ValidCollectionSizes_GreaterThanOne")] + [MemberData(nameof(ValidCollectionSizes_GreaterThanOne))] public void Sort_IComparer_WithoutDuplicates(int count) { List<T> list = GenericListFactory(count); @@ -66,7 +66,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes_GreaterThanOne")] + [MemberData(nameof(ValidCollectionSizes_GreaterThanOne))] public void Sort_IComparer_WithDuplicates(int count) { List<T> list = GenericListFactory(count); @@ -84,7 +84,7 @@ namespace System.Collections.Tests #region Sort(Comparison) [Theory] - [MemberData("ValidCollectionSizes_GreaterThanOne")] + [MemberData(nameof(ValidCollectionSizes_GreaterThanOne))] public void Sort_Comparison_WithoutDuplicates(int count) { List<T> list = GenericListFactory(count); @@ -98,7 +98,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes_GreaterThanOne")] + [MemberData(nameof(ValidCollectionSizes_GreaterThanOne))] public void Sort_Comparison_WithDuplicates(int count) { List<T> list = GenericListFactory(count); @@ -117,7 +117,7 @@ namespace System.Collections.Tests #region Sort(int, int, IComparer<T>) [Theory] - [MemberData("ValidCollectionSizes_GreaterThanOne")] + [MemberData(nameof(ValidCollectionSizes_GreaterThanOne))] public void Sort_intintIComparer_WithoutDuplicates(int count) { List<T> unsortedList = GenericListFactory(count); @@ -133,7 +133,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes_GreaterThanOne")] + [MemberData(nameof(ValidCollectionSizes_GreaterThanOne))] public void Sort_intintIComparer_WithDuplicates(int count) { List<T> unsortedList = GenericListFactory(count); @@ -150,7 +150,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void Sort_intintIComparer_NegativeRange_ThrowsArgumentOutOfRangeException(int count) { List<T> list = GenericListFactory(count); @@ -176,7 +176,7 @@ namespace System.Collections.Tests } [Theory] - [MemberData("ValidCollectionSizes")] + [MemberData(nameof(ValidCollectionSizes))] public void Sort_intintIComparer_InvalidRange_ThrowsArgumentException(int count) { List<T> list = GenericListFactory(count); diff --git a/src/System.ComponentModel.EventBasedAsync/tests/AsyncCompletedEventArgsTests.cs b/src/System.ComponentModel.EventBasedAsync/tests/AsyncCompletedEventArgsTests.cs index df9e0155d2..10b8c8a797 100644 --- a/src/System.ComponentModel.EventBasedAsync/tests/AsyncCompletedEventArgsTests.cs +++ b/src/System.ComponentModel.EventBasedAsync/tests/AsyncCompletedEventArgsTests.cs @@ -37,7 +37,7 @@ namespace System.ComponentModel.EventBasedAsync.Tests } [Theory] - [MemberData("TestInput")] + [MemberData(nameof(TestInput))] public static void CtorTest(Exception expectedException, bool expectedCancelled, object expectedState) { var target = new AsyncCompletedEventArgsTests(expectedException, expectedCancelled, expectedState); @@ -47,7 +47,7 @@ namespace System.ComponentModel.EventBasedAsync.Tests } [Theory] - [MemberData("TestInput")] + [MemberData(nameof(TestInput))] public static void RaiseExceptionIfNecessaryTest(Exception expectedError, bool cancelled, Type expectedExceptionType) { var target = new AsyncCompletedEventArgsTests(expectedError, cancelled, null); diff --git a/src/System.ComponentModel.EventBasedAsync/tests/RunWorkerCompletedEventArgsTests.cs b/src/System.ComponentModel.EventBasedAsync/tests/RunWorkerCompletedEventArgsTests.cs index de170a4256..4653337f1e 100644 --- a/src/System.ComponentModel.EventBasedAsync/tests/RunWorkerCompletedEventArgsTests.cs +++ b/src/System.ComponentModel.EventBasedAsync/tests/RunWorkerCompletedEventArgsTests.cs @@ -35,7 +35,7 @@ namespace System.ComponentModel.EventBasedAsync.Tests } [Theory] - [MemberData("TestInput")] + [MemberData(nameof(TestInput))] public static void ResultPropertyTest(object expectedResult, Exception expectedError, bool cancelled, Type expectedExceptionType) { var target = new RunWorkerCompletedEventArgs(expectedResult, expectedError, cancelled); diff --git a/src/System.Console/tests/ConsoleKeyInfoTests.cs b/src/System.Console/tests/ConsoleKeyInfoTests.cs index 5e047e767e..bc2165a636 100644 --- a/src/System.Console/tests/ConsoleKeyInfoTests.cs +++ b/src/System.Console/tests/ConsoleKeyInfoTests.cs @@ -19,7 +19,7 @@ namespace System.Tests } [Theory] - [MemberData("AllCombinationsOfThreeBools")] + [MemberData(nameof(AllCombinationsOfThreeBools))] public void Ctor_ValueCtor_ValuesPassedToProperties(bool shift, bool alt, bool ctrl) { ConsoleKeyInfo cki = new ConsoleKeyInfo('a', ConsoleKey.A, shift, alt, ctrl); @@ -33,7 +33,7 @@ namespace System.Tests } [Theory] - [MemberData("SampleConsoleKeyInfos")] + [MemberData(nameof(SampleConsoleKeyInfos))] public void Equals_SameData(ConsoleKeyInfo cki) { ConsoleKeyInfo other = cki; // otherwise compiler warns about comparing the instance with itself @@ -47,7 +47,7 @@ namespace System.Tests } [Theory] - [MemberData("NotEqualConsoleKeyInfos")] + [MemberData(nameof(NotEqualConsoleKeyInfos))] public void NotEquals_DifferentData(ConsoleKeyInfo left, ConsoleKeyInfo right) { Assert.False(left == right); diff --git a/src/System.Diagnostics.Process/tests/ProcessTests.cs b/src/System.Diagnostics.Process/tests/ProcessTests.cs index c0f88b6fc4..e7cd452d42 100644 --- a/src/System.Diagnostics.Process/tests/ProcessTests.cs +++ b/src/System.Diagnostics.Process/tests/ProcessTests.cs @@ -602,7 +602,7 @@ namespace System.Diagnostics.Tests } [Theory, PlatformSpecific(PlatformID.Windows)] - [MemberData("GetTestProcess")] + [MemberData(nameof(GetTestProcess))] public void TestProcessOnRemoteMachineWindows(Process currentProcess, Process remoteProcess) { Assert.Equal(currentProcess.Id, remoteProcess.Id); diff --git a/src/System.Diagnostics.TextWriterTraceListener/tests/CtorsDelimiterTests.cs b/src/System.Diagnostics.TextWriterTraceListener/tests/CtorsDelimiterTests.cs index adc6773ee1..3a7e72f490 100644 --- a/src/System.Diagnostics.TextWriterTraceListener/tests/CtorsDelimiterTests.cs +++ b/src/System.Diagnostics.TextWriterTraceListener/tests/CtorsDelimiterTests.cs @@ -55,7 +55,7 @@ namespace System.Diagnostics.TextWriterTraceListenerTests } [Theory] - [MemberData("TestNames")] + [MemberData(nameof(TestNames))] public void TestConstructorWithStreamAndName(string testName) { var target = new DelimitedListTraceListener(FileStream.Null, testName); @@ -65,7 +65,7 @@ namespace System.Diagnostics.TextWriterTraceListenerTests } [Theory] - [MemberData("TestNames")] + [MemberData(nameof(TestNames))] public void TestConstructorWithWriterAndName(string testName) { StreamWriter testWriter = StreamWriter.Null; diff --git a/src/System.Diagnostics.TextWriterTraceListener/tests/CtorsStreamTests.cs b/src/System.Diagnostics.TextWriterTraceListener/tests/CtorsStreamTests.cs index 3a2154b836..8821e66539 100644 --- a/src/System.Diagnostics.TextWriterTraceListener/tests/CtorsStreamTests.cs +++ b/src/System.Diagnostics.TextWriterTraceListener/tests/CtorsStreamTests.cs @@ -95,7 +95,7 @@ namespace System.Diagnostics.TextWriterTraceListenerTests } [Theory] - [MemberData("TestNames")] + [MemberData(nameof(TestNames))] public void TestConstructorWithStreamAndName(string testName) { StreamWriter testWriter = StreamWriter.Null; diff --git a/src/System.Diagnostics.TextWriterTraceListener/tests/DelimiterWriteMethodTests.cs b/src/System.Diagnostics.TextWriterTraceListener/tests/DelimiterWriteMethodTests.cs index c7c7429640..f49b7ab528 100644 --- a/src/System.Diagnostics.TextWriterTraceListener/tests/DelimiterWriteMethodTests.cs +++ b/src/System.Diagnostics.TextWriterTraceListener/tests/DelimiterWriteMethodTests.cs @@ -44,7 +44,7 @@ namespace System.Diagnostics.TextWriterTraceListenerTests } [Theory] - [MemberData("TraceEventInvariants")] + [MemberData(nameof(TraceEventInvariants))] public void TraceEvent_FormatString_Test(TraceFilter filter, TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, object[] args) { using (var target = new DelimitedListTraceListener(_stream)) @@ -59,7 +59,7 @@ namespace System.Diagnostics.TextWriterTraceListenerTests } [Theory] - [MemberData("TraceEventInvariants")] + [MemberData(nameof(TraceEventInvariants))] public void TraceEvent_String_Test(TraceFilter filter, TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, object[] args) { string message = args != null ? string.Format(format, args) : format; @@ -96,7 +96,7 @@ namespace System.Diagnostics.TextWriterTraceListenerTests } [Theory] - [MemberData("TraceDataObjectInvariants")] + [MemberData(nameof(TraceDataObjectInvariants))] public void TraceData_Object_Test(TraceFilter filter, TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data) { using (var target = new DelimitedListTraceListener(_stream)) @@ -131,7 +131,7 @@ namespace System.Diagnostics.TextWriterTraceListenerTests } [Theory] - [MemberData("TraceDataObjectArrayInvariants")] + [MemberData(nameof(TraceDataObjectArrayInvariants))] public void TraceData_ObjectArray_Test(string delimiter,TraceFilter filter, TraceEventCache eventCache, string source, TraceEventType eventType, int id, object[] data) { using (var target = new DelimitedListTraceListener(_stream)) diff --git a/src/System.Globalization/tests/CompareInfo.cs b/src/System.Globalization/tests/CompareInfo.cs index 564cca9ef8..92a7be8f65 100644 --- a/src/System.Globalization/tests/CompareInfo.cs +++ b/src/System.Globalization/tests/CompareInfo.cs @@ -26,7 +26,7 @@ public partial class CompareInfoTests } [Theory] - [MemberData("CompareToData")] + [MemberData(nameof(CompareToData))] [ActiveIssue(5463, PlatformID.AnyUnix)] public static void Compare(string localeName, string left, string right, int expected, CompareOptions options) { @@ -90,7 +90,7 @@ public partial class CompareInfoTests } [Theory] - [MemberData("IndexOfData")] + [MemberData(nameof(IndexOfData))] [ActiveIssue(5463, PlatformID.AnyUnix)] public static void IndexOf(string localeName, string source, string value, int expectedResult, CompareOptions options) { @@ -195,7 +195,7 @@ public partial class CompareInfoTests } [Theory] - [MemberData("LastIndexOfData")] + [MemberData(nameof(LastIndexOfData))] [ActiveIssue(5463, PlatformID.AnyUnix)] public static void LastIndexOf(string localeName, string source, string value, int expectedResult, CompareOptions options) { @@ -288,7 +288,7 @@ public partial class CompareInfoTests } [Theory] - [MemberData("IsPrefixData")] + [MemberData(nameof(IsPrefixData))] [ActiveIssue(5463, PlatformID.AnyUnix)] public static void IsPrefix(string localeName, string source, string prefix, bool expectedResult, CompareOptions options) { @@ -324,7 +324,7 @@ public partial class CompareInfoTests } [Theory] - [MemberData("IsSuffixData")] + [MemberData(nameof(IsSuffixData))] [ActiveIssue(5463, PlatformID.AnyUnix)] public static void IsSuffix(string localeName, string source, string suffix, bool expectedResult, CompareOptions options) { diff --git a/src/System.IO.Compression/tests/DeflateStreamTests.cs b/src/System.IO.Compression/tests/DeflateStreamTests.cs index d3bfd9e317..d04419d969 100644 --- a/src/System.IO.Compression/tests/DeflateStreamTests.cs +++ b/src/System.IO.Compression/tests/DeflateStreamTests.cs @@ -683,7 +683,7 @@ namespace System.IO.Compression.Tests [OuterLoop] [Theory] - [MemberData("RoundtripCompressDecompressOuterData")] + [MemberData(nameof(RoundtripCompressDecompressOuterData))] public async Task RoundtripCompressDecompress(bool useAsync, bool useGzip, int chunkSize, int totalSize, CompressionLevel level) { byte[] data = new byte[totalSize]; @@ -708,7 +708,7 @@ namespace System.IO.Compression.Tests [OuterLoop] [Theory] - [MemberData("RoundtripCompressDecompressOuterData")] + [MemberData(nameof(RoundtripCompressDecompressOuterData))] public async Task RoundTripWithFlush(bool useAsync, bool useGzip, int chunkSize, int totalSize, CompressionLevel level) { byte[] data = new byte[totalSize]; @@ -737,7 +737,7 @@ namespace System.IO.Compression.Tests [OuterLoop] [Theory] - [MemberData("RoundtripCompressDecompressOuterData")] + [MemberData(nameof(RoundtripCompressDecompressOuterData))] public async Task WriteAfterFlushing(bool useAsync, bool useGzip, int chunkSize, int totalSize, CompressionLevel level) { byte[] data = new byte[totalSize]; @@ -772,7 +772,7 @@ namespace System.IO.Compression.Tests [OuterLoop] [Theory] - [MemberData("RoundtripCompressDecompressOuterData")] + [MemberData(nameof(RoundtripCompressDecompressOuterData))] public async Task FlushBeforeFirstWrites(bool useAsync, bool useGzip, int chunkSize, int totalSize, CompressionLevel level) { byte[] data = new byte[totalSize]; diff --git a/src/System.IO.FileSystem/tests/File/Copy.cs b/src/System.IO.FileSystem/tests/File/Copy.cs index 786952d62f..7bd7bef667 100644 --- a/src/System.IO.FileSystem/tests/File/Copy.cs +++ b/src/System.IO.FileSystem/tests/File/Copy.cs @@ -121,7 +121,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("CopyFileWithData_MemberData")] + [MemberData(nameof(CopyFileWithData_MemberData))] public void CopyFileWithData_MemberData(char[] data, bool readOnly) { string testFileSource = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/FileStream/WriteAsync.cs b/src/System.IO.FileSystem/tests/FileStream/WriteAsync.cs index 0dbd7fdd92..a5592bc94b 100644 --- a/src/System.IO.FileSystem/tests/FileStream/WriteAsync.cs +++ b/src/System.IO.FileSystem/tests/FileStream/WriteAsync.cs @@ -341,7 +341,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("MemberData_FileStreamAsyncWriting")] + [MemberData(nameof(MemberData_FileStreamAsyncWriting))] [OuterLoop] // many combinations: we test just one in inner loop and the rest outer public async Task ManyConcurrentWriteAsyncs( bool useAsync, bool presize, bool exposeHandle, bool cancelable, int bufferSize, int writeSize, int numWrites) @@ -414,7 +414,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("MemberData_FileStreamAsyncWriting")] + [MemberData(nameof(MemberData_FileStreamAsyncWriting))] [OuterLoop] // many combinations: we test just one in inner loop and the rest outer public async Task CopyToAsyncBetweenFileStreams( bool useAsync, bool preSize, bool exposeHandle, bool cancelable, int bufferSize, int writeSize, int numWrites) diff --git a/src/System.IO.FileSystem/tests/Performance/Perf.FileStream.cs b/src/System.IO.FileSystem/tests/Performance/Perf.FileStream.cs index 83c7746372..454db6d8db 100644 --- a/src/System.IO.FileSystem/tests/Performance/Perf.FileStream.cs +++ b/src/System.IO.FileSystem/tests/Performance/Perf.FileStream.cs @@ -56,7 +56,7 @@ namespace System.IO.Tests /// If the bufferSize == 1, calls ReadByte instead of the traditional Read. /// </summary> [Benchmark] - [MemberData("ReadWriteTestParameters")] + [MemberData(nameof(ReadWriteTestParameters))] public async Task Read(bool useAsync, int bufferSize, int totalSize) { byte[] bytes = new byte[bufferSize]; @@ -95,7 +95,7 @@ namespace System.IO.Tests /// If the bufferSize == 1, calls WriteByte instead of the traditional Write. /// </summary> [Benchmark] - [MemberData("ReadWriteTestParameters")] + [MemberData(nameof(ReadWriteTestParameters))] public async Task Write(bool useAsync, int bufferSize, int totalSize) { byte[] bytes = CreateBytesToWrite(bufferSize); diff --git a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs index 013fbc6d29..844e4cc805 100644 --- a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs +++ b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs @@ -194,7 +194,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.AnyUnix)] [Theory] - [MemberData("CreateValidMapNames")] + [MemberData(nameof(CreateValidMapNames))] public void MapNamesNotSupported_Unix(string mapName) { const int Capacity = 4096; @@ -279,7 +279,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// and validating the creating maps each time they're created. /// </summary> [Theory] - [MemberData("MemberData_ValidArgumentCombinationsWithPath", + [MemberData(nameof(MemberData_ValidArgumentCombinationsWithPath), new FileMode[] { FileMode.Open, FileMode.OpenOrCreate }, new string[] { null, "CreateUniqueMapName()" }, new long[] { 1, 256, -1 /*pagesize*/, 10000 }, @@ -327,7 +327,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// and validating the creating maps each time they're created. /// </summary> [Theory] - [MemberData("MemberData_ValidArgumentCombinationsWithPath", + [MemberData(nameof(MemberData_ValidArgumentCombinationsWithPath), new FileMode[] { FileMode.CreateNew }, new string[] { null, "CreateUniqueMapName()" }, new long[] { 1, 256, -1 /*pagesize*/, 10000 }, @@ -353,7 +353,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// and validating the creating maps each time they're created. /// </summary> [Theory] - [MemberData("MemberData_ValidArgumentCombinationsWithPath", + [MemberData(nameof(MemberData_ValidArgumentCombinationsWithPath), new FileMode[] { FileMode.Create, FileMode.Truncate }, new string[] { null, "CreateUniqueMapName()" }, new long[] { 1, 256, -1 /*pagesize*/, 10000 }, @@ -438,7 +438,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// Test various combinations of arguments to CreateFromFile that accepts a FileStream. /// </summary> [Theory] - [MemberData("MemberData_ValidArgumentCombinationsWithStream", + [MemberData(nameof(MemberData_ValidArgumentCombinationsWithStream), new string[] { null, "CreateUniqueMapName()" }, new long[] { 1, 256, -1 /*pagesize*/, 10000 }, new MemoryMappedFileAccess[] { MemoryMappedFileAccess.Read, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileAccess.CopyOnWrite }, @@ -831,7 +831,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.Windows)] [Theory] - [MemberData("CreateValidMapNames")] + [MemberData(nameof(CreateValidMapNames))] public void ReusingNames_Windows(string name) { const int Capacity = 4096; diff --git a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateNew.Tests.cs b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateNew.Tests.cs index e620a6bbce..0f6299ac8f 100644 --- a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateNew.Tests.cs +++ b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateNew.Tests.cs @@ -127,7 +127,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.AnyUnix)] [Theory] - [MemberData("CreateValidMapNames")] + [MemberData(nameof(CreateValidMapNames))] public void MapNamesNotSupported_Unix(string mapName) { Assert.Throws<PlatformNotSupportedException>(() => MemoryMappedFile.CreateNew(mapName, 4096)); @@ -140,7 +140,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.Windows)] [Theory] - [MemberData("CreateValidMapNames")] + [MemberData(nameof(CreateValidMapNames))] [InlineData(null)] public void ValidMapNames_Windows(string name) { @@ -164,7 +164,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.Windows)] [Theory] - [MemberData("CreateValidMapNames")] + [MemberData(nameof(CreateValidMapNames))] public void ReusingNames_Windows(string name) { using (MemoryMappedFile mmf = MemoryMappedFile.CreateNew(name, 4096)) @@ -182,7 +182,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// Test various combinations of arguments to CreateNew, validating the created maps each time they're created. /// </summary> [Theory] - [MemberData("MemberData_ValidArgumentCombinations", + [MemberData(nameof(MemberData_ValidArgumentCombinations), new string[] { null, "CreateUniqueMapName()" }, new long[] { 1, 256, -1 /*pagesize*/, 10000 }, new MemoryMappedFileAccess[] { MemoryMappedFileAccess.Read, MemoryMappedFileAccess.ReadExecute, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileAccess.ReadWriteExecute, MemoryMappedFileAccess.CopyOnWrite }, @@ -258,7 +258,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.Windows)] [Theory] - [MemberData("CreateValidMapNames")] + [MemberData(nameof(CreateValidMapNames))] [InlineData(null)] public void DataNotPersistedBetweenMaps_Windows(string name) { diff --git a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateOrOpen.Tests.cs b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateOrOpen.Tests.cs index 777434374f..708eea87db 100644 --- a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateOrOpen.Tests.cs +++ b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateOrOpen.Tests.cs @@ -31,7 +31,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.AnyUnix)] [Theory] - [MemberData("CreateValidMapNames")] + [MemberData(nameof(CreateValidMapNames))] public void MapNamesNotSupported_Unix(string mapName) { Assert.Throws<PlatformNotSupportedException>(() => MemoryMappedFile.CreateOrOpen(mapName, 4096)); @@ -107,7 +107,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.Windows)] [Theory] - [MemberData("MemberData_ValidArgumentCombinations", + [MemberData(nameof(MemberData_ValidArgumentCombinations), new string[] { "CreateUniqueMapName()" }, new long[] { 1, 256, -1 /*pagesize*/, 10000 }, new MemoryMappedFileAccess[] { MemoryMappedFileAccess.Read, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileAccess.CopyOnWrite }, @@ -168,7 +168,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.Windows)] [Theory] - [MemberData("MemberData_ValidArgumentCombinations", + [MemberData(nameof(MemberData_ValidArgumentCombinations), new string[] { "CreateUniqueMapName()" }, new long[] { 1, 256, -1 /*pagesize*/, 10000 }, new MemoryMappedFileAccess[] { MemoryMappedFileAccess.ReadExecute, MemoryMappedFileAccess.ReadWriteExecute }, diff --git a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.OpenExisting.Tests.cs b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.OpenExisting.Tests.cs index 10bfff28f2..ac4b056fa0 100644 --- a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.OpenExisting.Tests.cs +++ b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.OpenExisting.Tests.cs @@ -27,7 +27,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.AnyUnix)] [Theory] - [MemberData("CreateValidMapNames")] + [MemberData(nameof(CreateValidMapNames))] public void MapNamesNotSupported_Unix(string mapName) { Assert.Throws<PlatformNotSupportedException>(() => MemoryMappedFile.OpenExisting(mapName)); @@ -75,7 +75,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.Windows)] [Theory] - [MemberData("MemberData_OpenCreated")] + [MemberData(nameof(MemberData_OpenCreated))] public void OpenCreatedNew(string mapName, MemoryMappedFileRights desiredAccessRights, HandleInheritability inheritability) { const int Capacity = 4096; @@ -108,7 +108,7 @@ namespace System.IO.MemoryMappedFiles.Tests /// </summary> [PlatformSpecific(PlatformID.Windows)] [Theory] - [MemberData("MemberData_OpenCreated")] + [MemberData(nameof(MemberData_OpenCreated))] public void OpenCreatedFromFile(string name, MemoryMappedFileRights rights, HandleInheritability inheritability) { const int Capacity = 4096; diff --git a/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Read.cs b/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Read.cs index c59ac2c4c4..37c8a67948 100644 --- a/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Read.cs +++ b/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Read.cs @@ -33,7 +33,7 @@ namespace System.IO.Pipes.Tests public abstract class AnonymousPipeTest_Read : PipeTest_Read { [Theory] - [MemberData("AsyncReadWriteChain_MemberData")] + [MemberData(nameof(AsyncReadWriteChain_MemberData))] public async Task AsyncReadWriteChain_CopyToAsync(int iterations, int writeBufferSize, int readBufferSize, bool cancelableToken) { var writeBuffer = new byte[writeBufferSize * iterations]; diff --git a/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Simple.cs b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Simple.cs index 934b49a356..8ef6934ee0 100644 --- a/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Simple.cs +++ b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Simple.cs @@ -32,7 +32,7 @@ namespace System.IO.Pipes.Tests } [Theory] - [MemberData("OneWayReadWritesMemberData")] + [MemberData(nameof(OneWayReadWritesMemberData))] public async Task OneWayReadWrites(PipeOptions serverOptions, PipeOptions clientOptions, bool asyncServerOps, bool asyncClientOps) { using (NamedPipePair pair = CreateNamedPipePair(serverOptions, clientOptions)) diff --git a/src/System.IO.Pipes/tests/PipeTest.Read.cs b/src/System.IO.Pipes/tests/PipeTest.Read.cs index 7894e7f265..05c54d5a9e 100644 --- a/src/System.IO.Pipes/tests/PipeTest.Read.cs +++ b/src/System.IO.Pipes/tests/PipeTest.Read.cs @@ -276,7 +276,7 @@ namespace System.IO.Pipes.Tests } [Theory] - [MemberData("AsyncReadWriteChain_MemberData")] + [MemberData(nameof(AsyncReadWriteChain_MemberData))] public async Task AsyncReadWriteChain_ReadWrite(int iterations, int writeBufferSize, int readBufferSize, bool cancelableToken) { var writeBuffer = new byte[writeBufferSize]; diff --git a/src/System.IO/tests/BinaryWriter/BinaryWriterTests.cs b/src/System.IO/tests/BinaryWriter/BinaryWriterTests.cs index 8bf3901e8a..479f767dd5 100644 --- a/src/System.IO/tests/BinaryWriter/BinaryWriterTests.cs +++ b/src/System.IO/tests/BinaryWriter/BinaryWriterTests.cs @@ -54,7 +54,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("EncodingAndEncodingStrings")] + [MemberData(nameof(EncodingAndEncodingStrings))] public void BinaryWriter_EncodingCtorAndWriteTests(Encoding encoding, string testString) { using (Stream memStream = CreateStream()) diff --git a/src/System.IO/tests/MemoryStream/MemoryStream.TryGetBufferTests.cs b/src/System.IO/tests/MemoryStream/MemoryStream.TryGetBufferTests.cs index d57727f82c..68051df807 100644 --- a/src/System.IO/tests/MemoryStream/MemoryStream.TryGetBufferTests.cs +++ b/src/System.IO/tests/MemoryStream/MemoryStream.TryGetBufferTests.cs @@ -97,7 +97,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedBySize")] + [MemberData(nameof(GetArraysVariedBySize))] public static void TryGetBuffer_Constructor_ByteArray_AlwaysReturnsEmptyArraySegment(byte[] array) { var stream = new MemoryStream(array); @@ -110,7 +110,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedBySize")] + [MemberData(nameof(GetArraysVariedBySize))] public static void TryGetBuffer_Constructor_ByteArray_Bool_AlwaysReturnsEmptyArraySegment(byte[] array) { var stream = new MemoryStream(array, writable: true); @@ -123,7 +123,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedByOffsetAndLength")] + [MemberData(nameof(GetArraysVariedByOffsetAndLength))] public static void TryGetBuffer_Constructor_ByteArray_Int32_Int32_AlwaysReturnsEmptyArraySegment(ArraySegment<byte> array) { var stream = new MemoryStream(array.Array, index: array.Offset, count: array.Count); @@ -136,7 +136,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedByOffsetAndLength")] + [MemberData(nameof(GetArraysVariedByOffsetAndLength))] public static void TryGetBuffer_Constructor_ByteArray_Int32_Int32_Bool_AlwaysReturnsEmptyArraySegment(ArraySegment<byte> array) { var stream = new MemoryStream(array.Array, index: array.Offset, count: array.Count, writable: true); @@ -149,7 +149,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedByOffsetAndLength")] + [MemberData(nameof(GetArraysVariedByOffsetAndLength))] public static void TryGetBuffer_Constructor_ByteArray_Int32_Int32_Bool_Bool_FalseAsPubliclyVisible_ReturnsEmptyArraySegment(ArraySegment<byte> array) { var stream = new MemoryStream(array.Array, index: array.Offset, count: array.Count, writable: true, publiclyVisible: false); @@ -185,7 +185,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedByOffsetAndLength")] + [MemberData(nameof(GetArraysVariedByOffsetAndLength))] public static void TryGetBuffer_Constructor_ByteArray_Int32_Int32_Bool_Bool_ValueAsIndexAndTrueAsPubliclyVisible_AlwaysReturnsOffsetSetToIndex(ArraySegment<byte> array) { var stream = new MemoryStream(array.Array, index: array.Offset, count: array.Count, writable: true, publiclyVisible: true); @@ -208,7 +208,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedBySize")] + [MemberData(nameof(GetArraysVariedBySize))] public static void TryGetBuffer_Constructor_ReturnsCountSetToWrittenLength(byte[] array) { var stream = new MemoryStream(); @@ -232,7 +232,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedBySize")] + [MemberData(nameof(GetArraysVariedBySize))] public static void TryGetBuffer_Constructor_Int32_ReturnsCountSetToWrittenLength(byte[] array) { var stream = new MemoryStream(512); @@ -245,7 +245,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedByOffsetAndLength")] + [MemberData(nameof(GetArraysVariedByOffsetAndLength))] public static void TryGetBuffer_Constructor_ByteArray_Int32_Int32_Bool_Bool_ValueAsCountAndTrueAsPubliclyVisible_AlwaysReturnsCountSetToCount(ArraySegment<byte> array) { var stream = new MemoryStream(array.Array, index: array.Offset, count: array.Count, writable: true, publiclyVisible: true); @@ -311,7 +311,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedByOffsetAndLength")] + [MemberData(nameof(GetArraysVariedByOffsetAndLength))] public static void TryGetBuffer_Constructor_ByteArray_Int32_Int32_Bool_Bool_ValueAsBufferAndTrueAsPubliclyVisible_AlwaysReturnsArraySetToBuffer(ArraySegment<byte> array) { var stream = new MemoryStream(array.Array, index: array.Offset, count: array.Count, writable: true, publiclyVisible: true); @@ -323,7 +323,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedByOffsetAndLength")] + [MemberData(nameof(GetArraysVariedByOffsetAndLength))] public static void TryGetBuffer_WhenDisposed_ReturnsTrue(ArraySegment<byte> array) { var stream = new MemoryStream(array.Array, index: array.Offset, count: array.Count, writable: true, publiclyVisible: true); @@ -338,7 +338,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedByOffsetAndLength")] + [MemberData(nameof(GetArraysVariedByOffsetAndLength))] public static void TryGetBuffer_WhenDisposed_ReturnsOffsetSetToIndex(ArraySegment<byte> array) { var stream = new MemoryStream(array.Array, index: array.Offset, count: array.Count, writable: true, publiclyVisible: true); @@ -351,7 +351,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedByOffsetAndLength")] + [MemberData(nameof(GetArraysVariedByOffsetAndLength))] public static void TryGetBuffer_WhenDisposed_ReturnsCountSetToCount(ArraySegment<byte> array) { var stream = new MemoryStream(array.Array, index: array.Offset, count: array.Count, writable: true, publiclyVisible: true); @@ -364,7 +364,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("GetArraysVariedByOffsetAndLength")] + [MemberData(nameof(GetArraysVariedByOffsetAndLength))] public static void TryGetBuffer_WhenDisposed_ReturnsArraySetToBuffer(ArraySegment<byte> array) { var stream = new MemoryStream(array.Array, index: array.Offset, count: array.Count, writable: true, publiclyVisible: true); diff --git a/src/System.IO/tests/Stream/Stream.NullTests.cs b/src/System.IO/tests/Stream/Stream.NullTests.cs index 0fc4ca8068..b57e03797a 100644 --- a/src/System.IO/tests/Stream/Stream.NullTests.cs +++ b/src/System.IO/tests/Stream/Stream.NullTests.cs @@ -33,7 +33,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("NullReaders")] + [MemberData(nameof(NullReaders))] public static void TestNullTextReader(TextReader input) { StreamReader sr = input as StreamReader; @@ -54,7 +54,7 @@ namespace System.IO.Tests } [Theory] - [MemberData("NullWriters")] + [MemberData(nameof(NullWriters))] public static void TextNullTextWriter(TextWriter output) { output.Flush(); diff --git a/src/System.Linq.Expressions/tests/BinaryOperators/Assignment/OpAssign.cs b/src/System.Linq.Expressions/tests/BinaryOperators/Assignment/OpAssign.cs index c295861db6..89da753b9f 100644 --- a/src/System.Linq.Expressions/tests/BinaryOperators/Assignment/OpAssign.cs +++ b/src/System.Linq.Expressions/tests/BinaryOperators/Assignment/OpAssign.cs @@ -12,7 +12,7 @@ namespace System.Linq.Expressions.Tests public class OpAssign { [Theory] - [MemberData("AssignAndEquivalentMethods")] + [MemberData(nameof(AssignAndEquivalentMethods))] public void AssignmentEquivalents(MethodInfo nonAssign, MethodInfo assign, Type type) { Func<Expression, Expression, Expression> withoutAssignment = (Func<Expression, Expression, Expression>)nonAssign.CreateDelegate(typeof(Func<Expression, Expression, Expression>)); @@ -66,7 +66,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("AssignAndEquivalentMethods")] + [MemberData(nameof(AssignAndEquivalentMethods))] public void AssignmentEquivalentsWithMemberAccess(MethodInfo nonAssign, MethodInfo assign, Type type) { Func<Expression, Expression, Expression> withoutAssignment = (Func<Expression, Expression, Expression>)nonAssign.CreateDelegate(typeof(Func<Expression, Expression, Expression>)); @@ -99,7 +99,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("AssignAndEquivalentMethods")] + [MemberData(nameof(AssignAndEquivalentMethods))] public void AssignmentEquivalentsWithIndexAccess(MethodInfo nonAssign, MethodInfo assign, Type type) { Func<Expression, Expression, Expression> withoutAssignment = (Func<Expression, Expression, Expression>)nonAssign.CreateDelegate(typeof(Func<Expression, Expression, Expression>)); @@ -132,7 +132,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("AssignmentMethods")] + [MemberData(nameof(AssignmentMethods))] public void AssignmentReducable(MethodInfo assign, Type type) { Func<Expression, Expression, Expression> withAssignment = (Func<Expression, Expression, Expression>)assign.CreateDelegate(typeof(Func<Expression, Expression, Expression>)); @@ -144,7 +144,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("AssignmentMethods")] + [MemberData(nameof(AssignmentMethods))] public void CannotAssignToNonWritable(MethodInfo assign, Type type) { Func<Expression, Expression, Expression> withAssignment = (Func<Expression, Expression, Expression>)assign.CreateDelegate(typeof(Func<Expression, Expression, Expression>)); @@ -153,7 +153,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("AssignmentMethods")] + [MemberData(nameof(AssignmentMethods))] public void AssignmentWithMemberAccessReducable(MethodInfo assign, Type type) { Func<Expression, Expression, Expression> withAssignment = (Func<Expression, Expression, Expression>)assign.CreateDelegate(typeof(Func<Expression, Expression, Expression>)); @@ -168,7 +168,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("AssignmentMethods")] + [MemberData(nameof(AssignmentMethods))] public void AssignmentWithIndexAccessReducable(MethodInfo assign, Type type) { Func<Expression, Expression, Expression> withAssignment = (Func<Expression, Expression, Expression>)assign.CreateDelegate(typeof(Func<Expression, Expression, Expression>)); @@ -192,7 +192,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("AssignmentMethods")] + [MemberData(nameof(AssignmentMethods))] public static void ThrowsOnLeftUnreadable(MethodInfo assign, Type type) { Func<Expression, Expression, Expression> withAssignment = (Func<Expression, Expression, Expression>)assign.CreateDelegate(typeof(Func<Expression, Expression, Expression>)); @@ -203,7 +203,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("AssignmentMethods")] + [MemberData(nameof(AssignmentMethods))] public static void ThrowsOnRightUnreadable(MethodInfo assign, Type type) { Func<Expression, Expression, Expression> withAssignment = (Func<Expression, Expression, Expression>)assign.CreateDelegate(typeof(Func<Expression, Expression, Expression>)); @@ -215,7 +215,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("AssignmentMethodsWithoutTypes")] + [MemberData(nameof(AssignmentMethodsWithoutTypes))] public void ThrowIfNoSuchBinaryOperation(MethodInfo assign) { Func<Expression, Expression, Expression> withAssignment = (Func<Expression, Expression, Expression>)assign.CreateDelegate(typeof(Func<Expression, Expression, Expression>)); diff --git a/src/System.Linq.Expressions/tests/BinaryOperators/GeneralBinaryTests.cs b/src/System.Linq.Expressions/tests/BinaryOperators/GeneralBinaryTests.cs index 18f4d78959..f51841e2a2 100644 --- a/src/System.Linq.Expressions/tests/BinaryOperators/GeneralBinaryTests.cs +++ b/src/System.Linq.Expressions/tests/BinaryOperators/GeneralBinaryTests.cs @@ -41,7 +41,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("NonBinaryTypesIncludingInvalidData")] + [MemberData(nameof(NonBinaryTypesIncludingInvalidData))] public void MakeBinaryInvalidType(ExpressionType type) { Assert.Throws<ArgumentException>(() => Expression.MakeBinary(type, Expression.Constant(0), Expression.Constant(0))); @@ -50,7 +50,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BinaryTypesData")] + [MemberData(nameof(BinaryTypesData))] public void MakeBinaryLeftNull(ExpressionType type) { Assert.Throws<ArgumentNullException>(() => Expression.MakeBinary(type, null, Expression.Constant(0))); @@ -59,7 +59,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BinaryTypesData")] + [MemberData(nameof(BinaryTypesData))] public void MakeBinaryRightNull(ExpressionType type) { Assert.Throws<ArgumentNullException>(() => Expression.MakeBinary(type, Expression.Variable(typeof(object)), null)); diff --git a/src/System.Linq.Expressions/tests/BinaryOperators/ReferenceComparison/ReferenceEqual.cs b/src/System.Linq.Expressions/tests/BinaryOperators/ReferenceComparison/ReferenceEqual.cs index 99a8a2ebe0..94ea9ab117 100644 --- a/src/System.Linq.Expressions/tests/BinaryOperators/ReferenceComparison/ReferenceEqual.cs +++ b/src/System.Linq.Expressions/tests/BinaryOperators/ReferenceComparison/ReferenceEqual.cs @@ -10,7 +10,7 @@ namespace System.Linq.Expressions.Tests public class ReferenceEqual : ReferenceEqualityTests { [Theory] - [MemberData("ReferenceObjectsData")] + [MemberData(nameof(ReferenceObjectsData))] public void TrueOnSame(object item) { Expression exp = Expression.ReferenceEqual( @@ -21,7 +21,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ReferenceTypesData")] + [MemberData(nameof(ReferenceTypesData))] public void TrueOnBothNull(Type type) { Expression exp = Expression.ReferenceEqual( @@ -32,7 +32,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ReferenceObjectsData")] + [MemberData(nameof(ReferenceObjectsData))] public void FalseIfLeftNull(object item) { Expression exp = Expression.ReferenceEqual( @@ -43,7 +43,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ReferenceObjectsData")] + [MemberData(nameof(ReferenceObjectsData))] public void FalseIfRightNull(object item) { Expression exp = Expression.ReferenceEqual( @@ -54,7 +54,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("DifferentObjects")] + [MemberData(nameof(DifferentObjects))] public void FalseIfDifferentObjectsAsObject(object x, object y) { Expression exp = Expression.ReferenceEqual( @@ -65,7 +65,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("DifferentObjects")] + [MemberData(nameof(DifferentObjects))] public void FalseIfDifferentObjectsOwnType(object x, object y) { Expression exp = Expression.ReferenceEqual( @@ -76,9 +76,9 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("LeftValueType")] - [MemberData("RightValueType")] - [MemberData("BothValueType")] + [MemberData(nameof(LeftValueType))] + [MemberData(nameof(RightValueType))] + [MemberData(nameof(BothValueType))] public void ThrowsOnValueTypeArguments(object x, object y) { Expression xExp = Expression.Constant(x); @@ -87,7 +87,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("UnassignablePairs")] + [MemberData(nameof(UnassignablePairs))] public void ThrowsOnUnassignablePairs(object x, object y) { Expression xExp = Expression.Constant(x); @@ -96,7 +96,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ComparableValuesData")] + [MemberData(nameof(ComparableValuesData))] public void TrueOnSameViaInterface(object item) { Expression exp = Expression.ReferenceEqual( @@ -107,7 +107,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("DifferentComparableValues")] + [MemberData(nameof(DifferentComparableValues))] public void FalseOnDifferentViaInterface(object x, object y) { Expression exp = Expression.ReferenceEqual( @@ -118,7 +118,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ComparableReferenceTypesData")] + [MemberData(nameof(ComparableReferenceTypesData))] public void TrueOnSameLeftViaInterface(object item) { Expression exp = Expression.ReferenceEqual( @@ -129,7 +129,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ComparableReferenceTypesData")] + [MemberData(nameof(ComparableReferenceTypesData))] public void TrueOnSameRightViaInterface(object item) { Expression exp = Expression.ReferenceEqual( diff --git a/src/System.Linq.Expressions/tests/BinaryOperators/ReferenceComparison/ReferenceNotEqual.cs b/src/System.Linq.Expressions/tests/BinaryOperators/ReferenceComparison/ReferenceNotEqual.cs index e80755180e..9bbe93e7f5 100644 --- a/src/System.Linq.Expressions/tests/BinaryOperators/ReferenceComparison/ReferenceNotEqual.cs +++ b/src/System.Linq.Expressions/tests/BinaryOperators/ReferenceComparison/ReferenceNotEqual.cs @@ -10,7 +10,7 @@ namespace System.Linq.Expressions.Tests public class ReferenceNotEqual : ReferenceEqualityTests { [Theory] - [MemberData("ReferenceObjectsData")] + [MemberData(nameof(ReferenceObjectsData))] public void FalseOnSame(object item) { Expression exp = Expression.ReferenceNotEqual( @@ -21,7 +21,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ReferenceTypesData")] + [MemberData(nameof(ReferenceTypesData))] public void FalseOnBothNull(Type type) { Expression exp = Expression.ReferenceNotEqual( @@ -32,7 +32,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ReferenceObjectsData")] + [MemberData(nameof(ReferenceObjectsData))] public void TrueIfLeftNull(object item) { Expression exp = Expression.ReferenceNotEqual( @@ -43,7 +43,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ReferenceObjectsData")] + [MemberData(nameof(ReferenceObjectsData))] public void TrueIfRightNull(object item) { Expression exp = Expression.ReferenceNotEqual( @@ -54,7 +54,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("DifferentObjects")] + [MemberData(nameof(DifferentObjects))] public void TrueIfDifferentObjectsAsObject(object x, object y) { Expression exp = Expression.ReferenceNotEqual( @@ -65,7 +65,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("DifferentObjects")] + [MemberData(nameof(DifferentObjects))] public void TrueIfDifferentObjectsOwnType(object x, object y) { Expression exp = Expression.ReferenceNotEqual( @@ -76,9 +76,9 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("LeftValueType")] - [MemberData("RightValueType")] - [MemberData("BothValueType")] + [MemberData(nameof(LeftValueType))] + [MemberData(nameof(RightValueType))] + [MemberData(nameof(BothValueType))] public void ThrowsOnValueTypeArguments(object x, object y) { Expression xExp = Expression.Constant(x); @@ -87,7 +87,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("UnassignablePairs")] + [MemberData(nameof(UnassignablePairs))] public void ThrowsOnUnassignablePairs(object x, object y) { Expression xExp = Expression.Constant(x); @@ -96,7 +96,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ComparableValuesData")] + [MemberData(nameof(ComparableValuesData))] public void FalseOnSameViaInterface(object item) { Expression exp = Expression.ReferenceNotEqual( @@ -107,7 +107,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("DifferentComparableValues")] + [MemberData(nameof(DifferentComparableValues))] public void TrueOnDifferentViaInterface(object x, object y) { Expression exp = Expression.ReferenceNotEqual( @@ -118,7 +118,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ComparableReferenceTypesData")] + [MemberData(nameof(ComparableReferenceTypesData))] public void FalseOnSameLeftViaInterface(object item) { Expression exp = Expression.ReferenceNotEqual( @@ -129,7 +129,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ComparableReferenceTypesData")] + [MemberData(nameof(ComparableReferenceTypesData))] public void FalseOnSameRightViaInterface(object item) { Expression exp = Expression.ReferenceNotEqual( diff --git a/src/System.Linq.Expressions/tests/Block/NoParameterBlockTests.cs b/src/System.Linq.Expressions/tests/Block/NoParameterBlockTests.cs index c3784513c9..1803e34d80 100644 --- a/src/System.Linq.Expressions/tests/Block/NoParameterBlockTests.cs +++ b/src/System.Linq.Expressions/tests/Block/NoParameterBlockTests.cs @@ -12,7 +12,7 @@ namespace System.Linq.Expressions.Tests public class NoParameterBlockTests : SharedBlockTests { [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void SingleElementBlock(object value) { Type type = value.GetType(); @@ -28,7 +28,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void DoubleElementBlock(object value) { Type type = value.GetType(); @@ -59,7 +59,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void TripleElementBlock(object value) { Type type = value.GetType(); @@ -93,7 +93,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void QuadrupleElementBlock(object value) { Type type = value.GetType(); @@ -130,7 +130,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void QuintupleElementBlock(object value) { Type type = value.GetType(); @@ -170,7 +170,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void SextupleElementBlock(object value) { Type type = value.GetType(); @@ -205,7 +205,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BlockSizes")] + [MemberData(nameof(BlockSizes))] public void NullExpressionInExpressionList(int size) { List<Expression> expressionList = Enumerable.Range(0, size).Select(i => (Expression)Expression.Constant(1)).ToList(); @@ -223,7 +223,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BlockSizes")] + [MemberData(nameof(BlockSizes))] public void UnreadableExpressionInExpressionList(int size) { List<Expression> expressionList = Enumerable.Range(0, size).Select(i => (Expression)Expression.Constant(1)).ToList(); @@ -241,7 +241,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ObjectAssignableConstantValuesAndSizes")] + [MemberData(nameof(ObjectAssignableConstantValuesAndSizes))] public void BlockExplicitType(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -254,7 +254,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BlockSizes")] + [MemberData(nameof(BlockSizes))] public void BlockInvalidExplicitType(int blockSize) { ConstantExpression constant = Expression.Constant(0); @@ -264,7 +264,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void InvalidExpressionIndex(object value, int blockSize) { BlockExpression block = Expression.Block(PadBlock(blockSize - 1, Expression.Constant(value, value.GetType()))); @@ -280,7 +280,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void ResultPropertyFromParams(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -292,7 +292,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void ResultPropertyFromEnumerable(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -304,7 +304,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void VariableCountZeroOnNonVariableAcceptingForms(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -316,7 +316,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] [ActiveIssue(3883)] public void RewriteToSameWithSameValues(object value, int blockSize) { @@ -329,7 +329,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void CanFindItems(object value, int blockSize) { ConstantExpression[] values = new ConstantExpression[blockSize]; @@ -345,7 +345,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void IdentifyNonAbsentItemAsAbsent(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -358,7 +358,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void ExpressionsEnumerable(object value, int blockSize) { ConstantExpression[] values = new ConstantExpression[blockSize]; @@ -374,7 +374,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void UpdateWithExpressionsReturnsSame(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -386,7 +386,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void Visit(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -398,7 +398,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ObjectAssignableConstantValuesAndSizes")] + [MemberData(nameof(ObjectAssignableConstantValuesAndSizes))] public void VisitTyped(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); diff --git a/src/System.Linq.Expressions/tests/Block/ParameterBlockTests.cs b/src/System.Linq.Expressions/tests/Block/ParameterBlockTests.cs index 49837cf73b..172049c103 100644 --- a/src/System.Linq.Expressions/tests/Block/ParameterBlockTests.cs +++ b/src/System.Linq.Expressions/tests/Block/ParameterBlockTests.cs @@ -17,7 +17,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void SingleElementBlock(object value) { Type type = value.GetType(); @@ -34,7 +34,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void DoubleElementBlock(object value) { Type type = value.GetType(); @@ -68,7 +68,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BlockSizes")] + [MemberData(nameof(BlockSizes))] public void NullExpressionInExpressionList(int size) { List<Expression> expressionList = Enumerable.Range(0, size).Select(i => (Expression)Expression.Constant(1)).ToList(); @@ -84,7 +84,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BlockSizes")] + [MemberData(nameof(BlockSizes))] public void UnreadableExpressionInExpressionList(int size) { List<Expression> expressionList = Enumerable.Range(0, size).Select(i => (Expression)Expression.Constant(1)).ToList(); @@ -100,7 +100,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ObjectAssignableConstantValuesAndSizes")] + [MemberData(nameof(ObjectAssignableConstantValuesAndSizes))] public void BlockExplicitType(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -113,7 +113,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BlockSizes")] + [MemberData(nameof(BlockSizes))] public void BlockInvalidExplicitType(int blockSize) { ConstantExpression constant = Expression.Constant(0); @@ -123,7 +123,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void BlockFromEmptyParametersSameAsFromParams(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -139,7 +139,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void InvalidExpressionIndex(object value, int blockSize) { BlockExpression block = Expression.Block(SingleParameter, PadBlock(blockSize - 1, Expression.Constant(value, value.GetType()))); @@ -155,7 +155,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void ResultPropertyFromParams(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -167,7 +167,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void ResultPropertyFromEnumerable(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -179,7 +179,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void VariableCountCorrect(object value, int blockSize) { IEnumerable<ParameterExpression> vars = Enumerable.Range(0, blockSize).Select(i => Expression.Variable(value.GetType())); @@ -189,7 +189,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] [ActiveIssue(3883)] public void RewriteToSameWithSameValues(object value, int blockSize) { @@ -202,7 +202,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void CanFindItems(object value, int blockSize) { ConstantExpression[] values = new ConstantExpression[blockSize]; @@ -218,7 +218,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void IdentifyNonAbsentItemAsAbsent(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -231,7 +231,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void ExpressionsEnumerable(object value, int blockSize) { ConstantExpression[] values = new ConstantExpression[blockSize]; @@ -247,7 +247,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void UpdateWithExpressionsReturnsSame(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -259,7 +259,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValuesAndSizes")] + [MemberData(nameof(ConstantValuesAndSizes))] public void Visit(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -271,7 +271,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ObjectAssignableConstantValuesAndSizes")] + [MemberData(nameof(ObjectAssignableConstantValuesAndSizes))] public void VisitTyped(object value, int blockSize) { ConstantExpression constant = Expression.Constant(value, value.GetType()); @@ -283,7 +283,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BlockSizes")] + [MemberData(nameof(BlockSizes))] public void NullVariables(int blockSize) { IEnumerable<Expression> expressions = PadBlock(blockSize - 1, Expression.Constant(0)); @@ -296,7 +296,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BlockSizes")] + [MemberData(nameof(BlockSizes))] public void ByRefVariables(int blockSize) { IEnumerable<Expression> expressions = PadBlock(blockSize - 1, Expression.Constant(0)); @@ -309,7 +309,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("BlockSizes")] + [MemberData(nameof(BlockSizes))] public void RepeatedVariables(int blockSize) { IEnumerable<Expression> expressions = PadBlock(blockSize - 1, Expression.Constant(0)); diff --git a/src/System.Linq.Expressions/tests/ExpressionTests.cs b/src/System.Linq.Expressions/tests/ExpressionTests.cs index 67ea703489..972ac605e8 100644 --- a/src/System.Linq.Expressions/tests/ExpressionTests.cs +++ b/src/System.Linq.Expressions/tests/ExpressionTests.cs @@ -139,7 +139,7 @@ namespace System.Linq.Expressions.Tests Assert.Throws<InvalidOperationException>(() => exp.NodeType); } - [Theory, TestOrder(1), MemberData("AllNodeTypesPlusSomeInvalid")] + [Theory, TestOrder(1), MemberData(nameof(AllNodeTypesPlusSomeInvalid))] public void NodeTypeFromConstructor(ExpressionType nodeType) { Assert.Equal(nodeType, new ObsoleteIncompleteExpressionOverride(nodeType, typeof(int)).NodeType); @@ -159,7 +159,7 @@ namespace System.Linq.Expressions.Tests Assert.Throws<InvalidOperationException>(() => exp.Type); } - [Theory, TestOrder(1), MemberData("SomeTypes")] + [Theory, TestOrder(1), MemberData(nameof(SomeTypes))] public void TypeFromConstructor(Type type) { Assert.Equal(type, new ObsoleteIncompleteExpressionOverride(ExpressionType.Constant, type).Type); @@ -361,7 +361,7 @@ namespace System.Linq.Expressions.Tests } } - [Theory, MemberData("UnreadableExpressionData")] + [Theory, MemberData(nameof(UnreadableExpressionData))] public void ConfirmCannotRead(Expression unreadableExpression) { if (unreadableExpression == null) @@ -376,7 +376,7 @@ namespace System.Linq.Expressions.Tests Assert.Throws<ArgumentException>("expressions", () => Expression.Block(typeof(void), UnreadableExpressions)); } - [Theory, MemberData("UnwritableExpressionData")] + [Theory, MemberData(nameof(UnwritableExpressionData))] public void ConfirmCannotWrite(Expression unwritableExpression) { if (unwritableExpression == null) @@ -385,7 +385,7 @@ namespace System.Linq.Expressions.Tests Assert.Throws<ArgumentException>("left", () => Expression.Assign(unwritableExpression, Expression.Constant(0))); } - [Theory, MemberData("WritableExpressionData")] + [Theory, MemberData(nameof(WritableExpressionData))] public void ConfirmCanWrite(Expression writableExpression) { Expression.Assign(writableExpression, Expression.Default(writableExpression.Type)); diff --git a/src/System.Linq.Expressions/tests/Goto/Break.cs b/src/System.Linq.Expressions/tests/Goto/Break.cs index 6fbef25553..0344eead60 100644 --- a/src/System.Linq.Expressions/tests/Goto/Break.cs +++ b/src/System.Linq.Expressions/tests/Goto/Break.cs @@ -11,7 +11,7 @@ namespace System.Linq.Expressions.Tests public class Break : GotoExpressionTests { [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void JustBreakValue(object value) { Type type = value.GetType(); @@ -38,7 +38,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void BreakJumps(object value) { Type type = value.GetType(); @@ -52,7 +52,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NonVoidTargetBreakHasNoValue(Type type) { LabelTarget target = Expression.Label(type); @@ -60,7 +60,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NonVoidTargetBreakHasNoValueTypeExplicit(Type type) { LabelTarget target = Expression.Label(type); @@ -92,7 +92,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NullValueOnNonVoidBreak(Type type) { Assert.Throws<ArgumentException>(() => Expression.Break(Expression.Label(type))); @@ -101,7 +101,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void ExplicitNullTypeWithValue(object value) { Assert.Throws<ArgumentException>(() => Expression.Break(Expression.Label(value.GetType()), default(Type))); @@ -117,7 +117,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void CanAssignAnythingToVoid(object value) { LabelTarget target = Expression.Label(); @@ -130,14 +130,14 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("NonObjectAssignableConstantValueData")] + [MemberData(nameof(NonObjectAssignableConstantValueData))] public void CannotAssignValueTypesToObject(object value) { Assert.Throws<ArgumentException>(() => Expression.Break(Expression.Label(typeof(object)), Expression.Constant(value))); } [Theory] - [MemberData("ObjectAssignableConstantValueData")] + [MemberData(nameof(ObjectAssignableConstantValueData))] public void ExplicitTypeAssigned(object value) { LabelTarget target = Expression.Label(typeof(object)); diff --git a/src/System.Linq.Expressions/tests/Goto/Continue.cs b/src/System.Linq.Expressions/tests/Goto/Continue.cs index 86ed5e4484..c79457b8fd 100644 --- a/src/System.Linq.Expressions/tests/Goto/Continue.cs +++ b/src/System.Linq.Expressions/tests/Goto/Continue.cs @@ -11,7 +11,7 @@ namespace System.Linq.Expressions.Tests public class Continue : GotoExpressionTests { [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NonVoidTargetContinueHasNoValue(Type type) { LabelTarget target = Expression.Label(type); @@ -19,7 +19,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NonVoidTargetContinueHasNoValueTypeExplicit(Type type) { LabelTarget target = Expression.Label(type); @@ -51,14 +51,14 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NullValueOnNonVoidContinue(Type type) { Assert.Throws<ArgumentException>(() => Expression.Continue(Expression.Label(type))); } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void ExplicitNullTypeWithValue(object value) { Assert.Throws<ArgumentException>(() => Expression.Continue(Expression.Label(value.GetType()), default(Type))); diff --git a/src/System.Linq.Expressions/tests/Goto/Goto.cs b/src/System.Linq.Expressions/tests/Goto/Goto.cs index 425be83301..0e55f693ea 100644 --- a/src/System.Linq.Expressions/tests/Goto/Goto.cs +++ b/src/System.Linq.Expressions/tests/Goto/Goto.cs @@ -11,7 +11,7 @@ namespace System.Linq.Expressions.Tests public class Goto : GotoExpressionTests { [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void JustGotoValue(object value) { Type type = value.GetType(); @@ -38,7 +38,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void GotoJumps(object value) { Type type = value.GetType(); @@ -52,7 +52,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NonVoidTargetGotoHasNoValue(Type type) { LabelTarget target = Expression.Label(type); @@ -60,7 +60,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NonVoidTargetGotoHasNoValueTypeExplicit(Type type) { LabelTarget target = Expression.Label(type); @@ -92,7 +92,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NullValueOnNonVoidGoto(Type type) { Assert.Throws<ArgumentException>(() => Expression.Goto(Expression.Label(type))); @@ -101,7 +101,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void ExplicitNullTypeWithValue(object value) { Assert.Throws<ArgumentException>(() => Expression.Goto(Expression.Label(value.GetType()), default(Type))); @@ -117,7 +117,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void CanAssignAnythingToVoid(object value) { LabelTarget target = Expression.Label(); @@ -130,14 +130,14 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("NonObjectAssignableConstantValueData")] + [MemberData(nameof(NonObjectAssignableConstantValueData))] public void CannotAssignValueTypesToObject(object value) { Assert.Throws<ArgumentException>(() => Expression.Goto(Expression.Label(typeof(object)), Expression.Constant(value))); } [Theory] - [MemberData("ObjectAssignableConstantValueData")] + [MemberData(nameof(ObjectAssignableConstantValueData))] public void ExplicitTypeAssigned(object value) { LabelTarget target = Expression.Label(typeof(object)); diff --git a/src/System.Linq.Expressions/tests/Goto/GotoExpressionTests.cs b/src/System.Linq.Expressions/tests/Goto/GotoExpressionTests.cs index 6520d88c9c..e0bfe9b727 100644 --- a/src/System.Linq.Expressions/tests/Goto/GotoExpressionTests.cs +++ b/src/System.Linq.Expressions/tests/Goto/GotoExpressionTests.cs @@ -36,26 +36,26 @@ namespace System.Linq.Expressions.Tests return ObjectAssignableTypes().Concat(NonObjectAssignableTypes()); } - private static IEnumerable<object[]> TypesData() + public static IEnumerable<object[]> TypesData() { return Types().Select(i => new object[] { i }); } - private static IEnumerable<object> ObjectAssignableConstantValues() + public static IEnumerable<object> ObjectAssignableConstantValues() { yield return new object(); yield return "Hello"; yield return new Uri("http://example.net/"); } - private static IEnumerable<object> NonObjectAssignableConstantValues() + public static IEnumerable<object> NonObjectAssignableConstantValues() { yield return 42; yield return 42L; yield return DateTime.MinValue; } - private static IEnumerable<object> ConstantValues() + public static IEnumerable<object> ConstantValues() { return NonObjectAssignableConstantValues().Concat(ObjectAssignableConstantValues()); } diff --git a/src/System.Linq.Expressions/tests/Goto/Return.cs b/src/System.Linq.Expressions/tests/Goto/Return.cs index 813cf5a131..0168060a90 100644 --- a/src/System.Linq.Expressions/tests/Goto/Return.cs +++ b/src/System.Linq.Expressions/tests/Goto/Return.cs @@ -11,7 +11,7 @@ namespace System.Linq.Expressions.Tests public class Return : GotoExpressionTests { [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void JustReturnValue(object value) { Type type = value.GetType(); @@ -38,7 +38,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void ReturnJumps(object value) { Type type = value.GetType(); @@ -52,7 +52,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NonVoidTargetReturnHasNoValue(Type type) { LabelTarget target = Expression.Label(type); @@ -60,7 +60,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NonVoidTargetReturnHasNoValueTypeExplicit(Type type) { LabelTarget target = Expression.Label(type); @@ -92,7 +92,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("TypesData")] + [MemberData(nameof(TypesData))] public void NullValueOnNonVoidReturn(Type type) { Assert.Throws<ArgumentException>(() => Expression.Return(Expression.Label(type))); @@ -101,7 +101,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void ExplicitNullTypeWithValue(object value) { Assert.Throws<ArgumentException>(() => Expression.Return(Expression.Label(value.GetType()), default(Type))); @@ -117,7 +117,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ConstantValueData")] + [MemberData(nameof(ConstantValueData))] public void CanAssignAnythingToVoid(object value) { LabelTarget target = Expression.Label(); @@ -130,14 +130,14 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("NonObjectAssignableConstantValueData")] + [MemberData(nameof(NonObjectAssignableConstantValueData))] public void CannotAssignValueTypesToObject(object value) { Assert.Throws<ArgumentException>(() => Expression.Return(Expression.Label(typeof(object)), Expression.Constant(value))); } [Theory] - [MemberData("ObjectAssignableConstantValueData")] + [MemberData(nameof(ObjectAssignableConstantValueData))] public void ExplicitTypeAssigned(object value) { LabelTarget target = Expression.Label(typeof(object)); diff --git a/src/System.Linq.Expressions/tests/TypeBinary/TypeEqual.cs b/src/System.Linq.Expressions/tests/TypeBinary/TypeEqual.cs index 1a5145dcc9..81c57cca85 100644 --- a/src/System.Linq.Expressions/tests/TypeBinary/TypeEqual.cs +++ b/src/System.Linq.Expressions/tests/TypeBinary/TypeEqual.cs @@ -48,35 +48,35 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void TypePropertyMatches(Expression expression, Type type) { Assert.Equal(type, Expression.TypeEqual(expression, type).TypeOperand); } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void TypeIsBoolean(Expression expression, Type type) { Assert.Equal(typeof(bool), Expression.TypeEqual(expression, type).Type); } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void NodeType(Expression expression, Type type) { Assert.Equal(ExpressionType.TypeEqual, Expression.TypeEqual(expression, type).NodeType); } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void ExpressionIsThatPassed(Expression expression, Type type) { Assert.Same(expression, Expression.TypeEqual(expression, type).Expression); } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void ExpressionEvaluationCompiled(Expression expression, Type type) { bool expected; @@ -97,7 +97,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void ExpressionEvaluationInterpretted(Expression expression, Type type) { bool expected; @@ -118,7 +118,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void ExpressionEvaluationWithParameterCompiled(Expression expression, Type type) { if (expression.Type == typeof(void)) @@ -149,7 +149,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void ExpressionEvaluationWithParameterInterpretted(Expression expression, Type type) { if (expression.Type == typeof(void)) diff --git a/src/System.Linq.Expressions/tests/TypeBinary/TypeIs.cs b/src/System.Linq.Expressions/tests/TypeBinary/TypeIs.cs index 2563ea50b0..9064b9fcdc 100644 --- a/src/System.Linq.Expressions/tests/TypeBinary/TypeIs.cs +++ b/src/System.Linq.Expressions/tests/TypeBinary/TypeIs.cs @@ -48,35 +48,35 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void TypePropertyMatches(Expression expression, Type type) { Assert.Equal(type, Expression.TypeIs(expression, type).TypeOperand); } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void TypeIsBoolean(Expression expression, Type type) { Assert.Equal(typeof(bool), Expression.TypeIs(expression, type).Type); } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void NodeType(Expression expression, Type type) { Assert.Equal(ExpressionType.TypeIs, Expression.TypeIs(expression, type).NodeType); } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void ExpressionIsThatPassed(Expression expression, Type type) { Assert.Same(expression, Expression.TypeIs(expression, type).Expression); } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void ExpressionEvaluationCompiled(Expression expression, Type type) { bool expected = expression.Type == typeof(void) @@ -87,7 +87,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void ExpressionEvaluationInterpretted(Expression expression, Type type) { bool expected = expression.Type == typeof(void) @@ -98,7 +98,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void ExpressionEvaluationWithParameterCompiled(Expression expression, Type type) { if (expression.Type == typeof(void)) @@ -122,7 +122,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ExpressionAndTypeCombinations")] + [MemberData(nameof(ExpressionAndTypeCombinations))] public void ExpressionEvaluationWithParameterInterpretted(Expression expression, Type type) { if (expression.Type == typeof(void)) diff --git a/src/System.Linq.Expressions/tests/Unary/IncDecAssign/IncDecAssignTests.cs b/src/System.Linq.Expressions/tests/Unary/IncDecAssign/IncDecAssignTests.cs index e874094551..d619daa102 100644 --- a/src/System.Linq.Expressions/tests/Unary/IncDecAssign/IncDecAssignTests.cs +++ b/src/System.Linq.Expressions/tests/Unary/IncDecAssign/IncDecAssignTests.cs @@ -17,12 +17,12 @@ namespace System.Linq.Expressions.Tests } } - private static IEnumerable<T?> NullableSequence<T>(IEnumerable<T> source) where T : struct + public static IEnumerable<T?> NullableSequence<T>(IEnumerable<T> source) where T : struct { return source.Select(i => (T?)i).Concat(Enumerable.Repeat(default(T?), 1)); } - private static IEnumerable<short> Int16s + public static IEnumerable<short> Int16s { get { @@ -40,7 +40,7 @@ namespace System.Linq.Expressions.Tests return Int16s.Select(i => new object[] { typeof(short), i, (short)(i + 1) }); } - private static IEnumerable<short?> NullableInt16s + public static IEnumerable<short?> NullableInt16s { get { return NullableSequence(Int16s); } } @@ -55,7 +55,7 @@ namespace System.Linq.Expressions.Tests return NullableInt16s.Select(i => new object[] { typeof(short?), i, (short?)(i + 1) }); } - private static IEnumerable<ushort> UInt16s + public static IEnumerable<ushort> UInt16s { get { @@ -73,7 +73,7 @@ namespace System.Linq.Expressions.Tests return UInt16s.Select(i => new object[] { typeof(ushort), i, (ushort)(i + 1) }); } - private static IEnumerable<ushort?> NullableUInt16s + public static IEnumerable<ushort?> NullableUInt16s { get { return NullableSequence(UInt16s); } } @@ -88,7 +88,7 @@ namespace System.Linq.Expressions.Tests return NullableUInt16s.Select(i => new object[] { typeof(ushort?), i, (ushort?)(i + 1) }); } - private static IEnumerable<int> Int32s + public static IEnumerable<int> Int32s { get { @@ -106,22 +106,22 @@ namespace System.Linq.Expressions.Tests return Int32s.Select(i => new object[] { typeof(int), i, i + 1 }); } - private static IEnumerable<int?> NullableInt32s + public static IEnumerable<int?> NullableInt32s { get { return NullableSequence(Int32s); } } - private static IEnumerable<object[]> NullableInt32sAndDecrements() + public static IEnumerable<object[]> NullableInt32sAndDecrements() { return NullableInt32s.Select(i => new object[] { typeof(int?), i, i - 1 }); } - private static IEnumerable<object[]> NullableInt32sAndIncrements() + public static IEnumerable<object[]> NullableInt32sAndIncrements() { return NullableInt32s.Select(i => new object[] { typeof(int?), i, i + 1 }); } - private static IEnumerable<uint> UInt32s + public static IEnumerable<uint> UInt32s { get { @@ -139,7 +139,7 @@ namespace System.Linq.Expressions.Tests return UInt32s.Select(i => new object[] { typeof(uint), i, i + 1 }); } - private static IEnumerable<uint?> NullableUInt32s + public static IEnumerable<uint?> NullableUInt32s { get { return NullableSequence(UInt32s); } } @@ -154,7 +154,7 @@ namespace System.Linq.Expressions.Tests return NullableUInt32s.Select(i => new object[] { typeof(uint?), i, i + 1 }); } - private static IEnumerable<long> Int64s + public static IEnumerable<long> Int64s { get { @@ -172,22 +172,22 @@ namespace System.Linq.Expressions.Tests return Int64s.Select(i => new object[] { typeof(long), i, i + 1 }); } - private static IEnumerable<long?> NullableInt64s + public static IEnumerable<long?> NullableInt64s { get { return NullableSequence(Int64s); } } - private static IEnumerable<object[]> NullableInt64sAndDecrements() + public static IEnumerable<object[]> NullableInt64sAndDecrements() { return NullableInt64s.Select(i => new object[] { typeof(long?), i, i - 1 }); } - private static IEnumerable<object[]> NullableInt64sAndIncrements() + public static IEnumerable<object[]> NullableInt64sAndIncrements() { return NullableInt64s.Select(i => new object[] { typeof(long?), i, i + 1 }); } - private static IEnumerable<ulong> UInt64s + public static IEnumerable<ulong> UInt64s { get { @@ -205,7 +205,7 @@ namespace System.Linq.Expressions.Tests return UInt64s.Select(i => new object[] { typeof(ulong), i, i + 1 }); } - private static IEnumerable<ulong?> NullableUInt64s + public static IEnumerable<ulong?> NullableUInt64s { get { return NullableSequence(UInt64s); } } @@ -220,7 +220,7 @@ namespace System.Linq.Expressions.Tests return NullableUInt64s.Select(i => new object[] { typeof(ulong?), i, i + 1 }); } - private static IEnumerable<decimal> Decimals + public static IEnumerable<decimal> Decimals { get { @@ -238,7 +238,7 @@ namespace System.Linq.Expressions.Tests return Decimals.Select(i => new object[] { typeof(decimal), i, i + 1 }); } - private static IEnumerable<decimal?> NullableDecimals + public static IEnumerable<decimal?> NullableDecimals { get { diff --git a/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PostDecrementAssignTests.cs b/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PostDecrementAssignTests.cs index e7954b74ee..28a94092eb 100644 --- a/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PostDecrementAssignTests.cs +++ b/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PostDecrementAssignTests.cs @@ -11,24 +11,24 @@ namespace System.Linq.Expressions.Tests public class PostDecrementAssignTests : IncDecAssignTests { [Theory] - [MemberData("Int16sAndDecrements")] - [MemberData("NullableInt16sAndDecrements")] - [MemberData("UInt16sAndDecrements")] - [MemberData("NullableUInt16sAndDecrements")] - [MemberData("Int32sAndDecrements")] - [MemberData("NullableInt32sAndDecrements")] - [MemberData("UInt32sAndDecrements")] - [MemberData("NullableUInt32sAndDecrements")] - [MemberData("Int64sAndDecrements")] - [MemberData("NullableInt64sAndDecrements")] - [MemberData("UInt64sAndDecrements")] - [MemberData("NullableUInt64sAndDecrements")] - [MemberData("DecimalsAndDecrements")] - [MemberData("NullableDecimalsAndDecrements")] - [MemberData("SinglesAndDecrements")] - [MemberData("NullableSinglesAndDecrements")] - [MemberData("DoublesAndDecrements")] - [MemberData("NullableDoublesAndDecrements")] + [MemberData(nameof(Int16sAndDecrements))] + [MemberData(nameof(NullableInt16sAndDecrements))] + [MemberData(nameof(UInt16sAndDecrements))] + [MemberData(nameof(NullableUInt16sAndDecrements))] + [MemberData(nameof(Int32sAndDecrements))] + [MemberData(nameof(NullableInt32sAndDecrements))] + [MemberData(nameof(UInt32sAndDecrements))] + [MemberData(nameof(NullableUInt32sAndDecrements))] + [MemberData(nameof(Int64sAndDecrements))] + [MemberData(nameof(NullableInt64sAndDecrements))] + [MemberData(nameof(UInt64sAndDecrements))] + [MemberData(nameof(NullableUInt64sAndDecrements))] + [MemberData(nameof(DecimalsAndDecrements))] + [MemberData(nameof(NullableDecimalsAndDecrements))] + [MemberData(nameof(SinglesAndDecrements))] + [MemberData(nameof(NullableSinglesAndDecrements))] + [MemberData(nameof(DoublesAndDecrements))] + [MemberData(nameof(NullableDoublesAndDecrements))] public void ReturnsCorrectValues(Type type, object value, object _) { ParameterExpression variable = Expression.Variable(type); @@ -41,24 +41,24 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("Int16sAndDecrements")] - [MemberData("NullableInt16sAndDecrements")] - [MemberData("UInt16sAndDecrements")] - [MemberData("NullableUInt16sAndDecrements")] - [MemberData("Int32sAndDecrements")] - [MemberData("NullableInt32sAndDecrements")] - [MemberData("UInt32sAndDecrements")] - [MemberData("NullableUInt32sAndDecrements")] - [MemberData("Int64sAndDecrements")] - [MemberData("NullableInt64sAndDecrements")] - [MemberData("UInt64sAndDecrements")] - [MemberData("NullableUInt64sAndDecrements")] - [MemberData("DecimalsAndDecrements")] - [MemberData("NullableDecimalsAndDecrements")] - [MemberData("SinglesAndDecrements")] - [MemberData("NullableSinglesAndDecrements")] - [MemberData("DoublesAndDecrements")] - [MemberData("NullableDoublesAndDecrements")] + [MemberData(nameof(Int16sAndDecrements))] + [MemberData(nameof(NullableInt16sAndDecrements))] + [MemberData(nameof(UInt16sAndDecrements))] + [MemberData(nameof(NullableUInt16sAndDecrements))] + [MemberData(nameof(Int32sAndDecrements))] + [MemberData(nameof(NullableInt32sAndDecrements))] + [MemberData(nameof(UInt32sAndDecrements))] + [MemberData(nameof(NullableUInt32sAndDecrements))] + [MemberData(nameof(Int64sAndDecrements))] + [MemberData(nameof(NullableInt64sAndDecrements))] + [MemberData(nameof(UInt64sAndDecrements))] + [MemberData(nameof(NullableUInt64sAndDecrements))] + [MemberData(nameof(DecimalsAndDecrements))] + [MemberData(nameof(NullableDecimalsAndDecrements))] + [MemberData(nameof(SinglesAndDecrements))] + [MemberData(nameof(NullableSinglesAndDecrements))] + [MemberData(nameof(DoublesAndDecrements))] + [MemberData(nameof(NullableDoublesAndDecrements))] public void AssignsCorrectValues(Type type, object value, object result) { ParameterExpression variable = Expression.Variable(type); @@ -112,7 +112,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("DecrementOverflowingValues")] + [MemberData(nameof(DecrementOverflowingValues))] public void OverflowingValuesThrow(object value) { ParameterExpression variable = Expression.Variable(value.GetType()); @@ -128,7 +128,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("UnincrementableAndUndecrementableTypes")] + [MemberData(nameof(UnincrementableAndUndecrementableTypes))] public void InvalidOperandType(Type type) { ParameterExpression variable = Expression.Variable(type); diff --git a/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PostIncrementAssignTests.cs b/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PostIncrementAssignTests.cs index a5bd60589e..9541d02933 100644 --- a/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PostIncrementAssignTests.cs +++ b/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PostIncrementAssignTests.cs @@ -11,24 +11,24 @@ namespace System.Linq.Expressions.Tests public class PostIncrementAssignTests : IncDecAssignTests { [Theory] - [MemberData("Int16sAndIncrements")] - [MemberData("NullableInt16sAndIncrements")] - [MemberData("UInt16sAndIncrements")] - [MemberData("NullableUInt16sAndIncrements")] - [MemberData("Int32sAndIncrements")] - [MemberData("NullableInt32sAndIncrements")] - [MemberData("UInt32sAndIncrements")] - [MemberData("NullableUInt32sAndIncrements")] - [MemberData("Int64sAndIncrements")] - [MemberData("NullableInt64sAndIncrements")] - [MemberData("UInt64sAndIncrements")] - [MemberData("NullableUInt64sAndIncrements")] - [MemberData("DecimalsAndIncrements")] - [MemberData("NullableDecimalsAndIncrements")] - [MemberData("SinglesAndIncrements")] - [MemberData("NullableSinglesAndIncrements")] - [MemberData("DoublesAndIncrements")] - [MemberData("NullableDoublesAndIncrements")] + [MemberData(nameof(Int16sAndIncrements))] + [MemberData(nameof(NullableInt16sAndIncrements))] + [MemberData(nameof(UInt16sAndIncrements))] + [MemberData(nameof(NullableUInt16sAndIncrements))] + [MemberData(nameof(Int32sAndIncrements))] + [MemberData(nameof(NullableInt32sAndIncrements))] + [MemberData(nameof(UInt32sAndIncrements))] + [MemberData(nameof(NullableUInt32sAndIncrements))] + [MemberData(nameof(Int64sAndIncrements))] + [MemberData(nameof(NullableInt64sAndIncrements))] + [MemberData(nameof(UInt64sAndIncrements))] + [MemberData(nameof(NullableUInt64sAndIncrements))] + [MemberData(nameof(DecimalsAndIncrements))] + [MemberData(nameof(NullableDecimalsAndIncrements))] + [MemberData(nameof(SinglesAndIncrements))] + [MemberData(nameof(NullableSinglesAndIncrements))] + [MemberData(nameof(DoublesAndIncrements))] + [MemberData(nameof(NullableDoublesAndIncrements))] public void ReturnsCorrectValues(Type type, object value, object _) { ParameterExpression variable = Expression.Variable(type); @@ -41,24 +41,24 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("Int16sAndIncrements")] - [MemberData("NullableInt16sAndIncrements")] - [MemberData("UInt16sAndIncrements")] - [MemberData("NullableUInt16sAndIncrements")] - [MemberData("Int32sAndIncrements")] - [MemberData("NullableInt32sAndIncrements")] - [MemberData("UInt32sAndIncrements")] - [MemberData("NullableUInt32sAndIncrements")] - [MemberData("Int64sAndIncrements")] - [MemberData("NullableInt64sAndIncrements")] - [MemberData("UInt64sAndIncrements")] - [MemberData("NullableUInt64sAndIncrements")] - [MemberData("DecimalsAndIncrements")] - [MemberData("NullableDecimalsAndIncrements")] - [MemberData("SinglesAndIncrements")] - [MemberData("NullableSinglesAndIncrements")] - [MemberData("DoublesAndIncrements")] - [MemberData("NullableDoublesAndIncrements")] + [MemberData(nameof(Int16sAndIncrements))] + [MemberData(nameof(NullableInt16sAndIncrements))] + [MemberData(nameof(UInt16sAndIncrements))] + [MemberData(nameof(NullableUInt16sAndIncrements))] + [MemberData(nameof(Int32sAndIncrements))] + [MemberData(nameof(NullableInt32sAndIncrements))] + [MemberData(nameof(UInt32sAndIncrements))] + [MemberData(nameof(NullableUInt32sAndIncrements))] + [MemberData(nameof(Int64sAndIncrements))] + [MemberData(nameof(NullableInt64sAndIncrements))] + [MemberData(nameof(UInt64sAndIncrements))] + [MemberData(nameof(NullableUInt64sAndIncrements))] + [MemberData(nameof(DecimalsAndIncrements))] + [MemberData(nameof(NullableDecimalsAndIncrements))] + [MemberData(nameof(SinglesAndIncrements))] + [MemberData(nameof(NullableSinglesAndIncrements))] + [MemberData(nameof(DoublesAndIncrements))] + [MemberData(nameof(NullableDoublesAndIncrements))] public void AssignsCorrectValues(Type type, object value, object result) { ParameterExpression variable = Expression.Variable(type); @@ -112,7 +112,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("IncrementOverflowingValues")] + [MemberData(nameof(IncrementOverflowingValues))] public void OverflowingValuesThrow(object value) { ParameterExpression variable = Expression.Variable(value.GetType()); @@ -128,7 +128,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("UnincrementableAndUndecrementableTypes")] + [MemberData(nameof(UnincrementableAndUndecrementableTypes))] public void InvalidOperandType(Type type) { ParameterExpression variable = Expression.Variable(type); diff --git a/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PreDecrementAssignTests.cs b/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PreDecrementAssignTests.cs index e6baba5510..a2f331249d 100644 --- a/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PreDecrementAssignTests.cs +++ b/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PreDecrementAssignTests.cs @@ -11,24 +11,24 @@ namespace System.Linq.Expressions.Tests public class PreDecrementAssignTests : IncDecAssignTests { [Theory] - [MemberData("Int16sAndDecrements")] - [MemberData("NullableInt16sAndDecrements")] - [MemberData("UInt16sAndDecrements")] - [MemberData("NullableUInt16sAndDecrements")] - [MemberData("Int32sAndDecrements")] - [MemberData("NullableInt32sAndDecrements")] - [MemberData("UInt32sAndDecrements")] - [MemberData("NullableUInt32sAndDecrements")] - [MemberData("Int64sAndDecrements")] - [MemberData("NullableInt64sAndDecrements")] - [MemberData("UInt64sAndDecrements")] - [MemberData("NullableUInt64sAndDecrements")] - [MemberData("DecimalsAndDecrements")] - [MemberData("NullableDecimalsAndDecrements")] - [MemberData("SinglesAndDecrements")] - [MemberData("NullableSinglesAndDecrements")] - [MemberData("DoublesAndDecrements")] - [MemberData("NullableDoublesAndDecrements")] + [MemberData(nameof(Int16sAndDecrements))] + [MemberData(nameof(NullableInt16sAndDecrements))] + [MemberData(nameof(UInt16sAndDecrements))] + [MemberData(nameof(NullableUInt16sAndDecrements))] + [MemberData(nameof(Int32sAndDecrements))] + [MemberData(nameof(NullableInt32sAndDecrements))] + [MemberData(nameof(UInt32sAndDecrements))] + [MemberData(nameof(NullableUInt32sAndDecrements))] + [MemberData(nameof(Int64sAndDecrements))] + [MemberData(nameof(NullableInt64sAndDecrements))] + [MemberData(nameof(UInt64sAndDecrements))] + [MemberData(nameof(NullableUInt64sAndDecrements))] + [MemberData(nameof(DecimalsAndDecrements))] + [MemberData(nameof(NullableDecimalsAndDecrements))] + [MemberData(nameof(SinglesAndDecrements))] + [MemberData(nameof(NullableSinglesAndDecrements))] + [MemberData(nameof(DoublesAndDecrements))] + [MemberData(nameof(NullableDoublesAndDecrements))] public void ReturnsCorrectValues(Type type, object value, object result) { ParameterExpression variable = Expression.Variable(type); @@ -41,24 +41,24 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("Int16sAndDecrements")] - [MemberData("NullableInt16sAndDecrements")] - [MemberData("UInt16sAndDecrements")] - [MemberData("NullableUInt16sAndDecrements")] - [MemberData("Int32sAndDecrements")] - [MemberData("NullableInt32sAndDecrements")] - [MemberData("UInt32sAndDecrements")] - [MemberData("NullableUInt32sAndDecrements")] - [MemberData("Int64sAndDecrements")] - [MemberData("NullableInt64sAndDecrements")] - [MemberData("UInt64sAndDecrements")] - [MemberData("NullableUInt64sAndDecrements")] - [MemberData("DecimalsAndDecrements")] - [MemberData("NullableDecimalsAndDecrements")] - [MemberData("SinglesAndDecrements")] - [MemberData("NullableSinglesAndDecrements")] - [MemberData("DoublesAndDecrements")] - [MemberData("NullableDoublesAndDecrements")] + [MemberData(nameof(Int16sAndDecrements))] + [MemberData(nameof(NullableInt16sAndDecrements))] + [MemberData(nameof(UInt16sAndDecrements))] + [MemberData(nameof(NullableUInt16sAndDecrements))] + [MemberData(nameof(Int32sAndDecrements))] + [MemberData(nameof(NullableInt32sAndDecrements))] + [MemberData(nameof(UInt32sAndDecrements))] + [MemberData(nameof(NullableUInt32sAndDecrements))] + [MemberData(nameof(Int64sAndDecrements))] + [MemberData(nameof(NullableInt64sAndDecrements))] + [MemberData(nameof(UInt64sAndDecrements))] + [MemberData(nameof(NullableUInt64sAndDecrements))] + [MemberData(nameof(DecimalsAndDecrements))] + [MemberData(nameof(NullableDecimalsAndDecrements))] + [MemberData(nameof(SinglesAndDecrements))] + [MemberData(nameof(NullableSinglesAndDecrements))] + [MemberData(nameof(DoublesAndDecrements))] + [MemberData(nameof(NullableDoublesAndDecrements))] public void AssignsCorrectValues(Type type, object value, object result) { ParameterExpression variable = Expression.Variable(type); @@ -112,7 +112,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("DecrementOverflowingValues")] + [MemberData(nameof(DecrementOverflowingValues))] public void OverflowingValuesThrow(object value) { ParameterExpression variable = Expression.Variable(value.GetType()); @@ -128,7 +128,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("UnincrementableAndUndecrementableTypes")] + [MemberData(nameof(UnincrementableAndUndecrementableTypes))] public void InvalidOperandType(Type type) { ParameterExpression variable = Expression.Variable(type); diff --git a/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PreIncrementAssignTests.cs b/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PreIncrementAssignTests.cs index 033679fa44..f8400d93ae 100644 --- a/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PreIncrementAssignTests.cs +++ b/src/System.Linq.Expressions/tests/Unary/IncDecAssign/PreIncrementAssignTests.cs @@ -11,24 +11,24 @@ namespace System.Linq.Expressions.Tests public class PreIncrementAssignTests : IncDecAssignTests { [Theory] - [MemberData("Int16sAndIncrements")] - [MemberData("NullableInt16sAndIncrements")] - [MemberData("UInt16sAndIncrements")] - [MemberData("NullableUInt16sAndIncrements")] - [MemberData("Int32sAndIncrements")] - [MemberData("NullableInt32sAndIncrements")] - [MemberData("UInt32sAndIncrements")] - [MemberData("NullableUInt32sAndIncrements")] - [MemberData("Int64sAndIncrements")] - [MemberData("NullableInt64sAndIncrements")] - [MemberData("UInt64sAndIncrements")] - [MemberData("NullableUInt64sAndIncrements")] - [MemberData("DecimalsAndIncrements")] - [MemberData("NullableDecimalsAndIncrements")] - [MemberData("SinglesAndIncrements")] - [MemberData("NullableSinglesAndIncrements")] - [MemberData("DoublesAndIncrements")] - [MemberData("NullableDoublesAndIncrements")] + [MemberData(nameof(Int16sAndIncrements))] + [MemberData(nameof(NullableInt16sAndIncrements))] + [MemberData(nameof(UInt16sAndIncrements))] + [MemberData(nameof(NullableUInt16sAndIncrements))] + [MemberData(nameof(Int32sAndIncrements))] + [MemberData(nameof(NullableInt32sAndIncrements))] + [MemberData(nameof(UInt32sAndIncrements))] + [MemberData(nameof(NullableUInt32sAndIncrements))] + [MemberData(nameof(Int64sAndIncrements))] + [MemberData(nameof(NullableInt64sAndIncrements))] + [MemberData(nameof(UInt64sAndIncrements))] + [MemberData(nameof(NullableUInt64sAndIncrements))] + [MemberData(nameof(DecimalsAndIncrements))] + [MemberData(nameof(NullableDecimalsAndIncrements))] + [MemberData(nameof(SinglesAndIncrements))] + [MemberData(nameof(NullableSinglesAndIncrements))] + [MemberData(nameof(DoublesAndIncrements))] + [MemberData(nameof(NullableDoublesAndIncrements))] public void ReturnsCorrectValues(Type type, object value, object result) { ParameterExpression variable = Expression.Variable(type); @@ -41,24 +41,24 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("Int16sAndIncrements")] - [MemberData("NullableInt16sAndIncrements")] - [MemberData("UInt16sAndIncrements")] - [MemberData("NullableUInt16sAndIncrements")] - [MemberData("Int32sAndIncrements")] - [MemberData("NullableInt32sAndIncrements")] - [MemberData("UInt32sAndIncrements")] - [MemberData("NullableUInt32sAndIncrements")] - [MemberData("Int64sAndIncrements")] - [MemberData("NullableInt64sAndIncrements")] - [MemberData("UInt64sAndIncrements")] - [MemberData("NullableUInt64sAndIncrements")] - [MemberData("DecimalsAndIncrements")] - [MemberData("NullableDecimalsAndIncrements")] - [MemberData("SinglesAndIncrements")] - [MemberData("NullableSinglesAndIncrements")] - [MemberData("DoublesAndIncrements")] - [MemberData("NullableDoublesAndIncrements")] + [MemberData(nameof(Int16sAndIncrements))] + [MemberData(nameof(NullableInt16sAndIncrements))] + [MemberData(nameof(UInt16sAndIncrements))] + [MemberData(nameof(NullableUInt16sAndIncrements))] + [MemberData(nameof(Int32sAndIncrements))] + [MemberData(nameof(NullableInt32sAndIncrements))] + [MemberData(nameof(UInt32sAndIncrements))] + [MemberData(nameof(NullableUInt32sAndIncrements))] + [MemberData(nameof(Int64sAndIncrements))] + [MemberData(nameof(NullableInt64sAndIncrements))] + [MemberData(nameof(UInt64sAndIncrements))] + [MemberData(nameof(NullableUInt64sAndIncrements))] + [MemberData(nameof(DecimalsAndIncrements))] + [MemberData(nameof(NullableDecimalsAndIncrements))] + [MemberData(nameof(SinglesAndIncrements))] + [MemberData(nameof(NullableSinglesAndIncrements))] + [MemberData(nameof(DoublesAndIncrements))] + [MemberData(nameof(NullableDoublesAndIncrements))] public void AssignsCorrectValues(Type type, object value, object result) { ParameterExpression variable = Expression.Variable(type); @@ -112,7 +112,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("IncrementOverflowingValues")] + [MemberData(nameof(IncrementOverflowingValues))] public void OverflowingValuesThrow(object value) { ParameterExpression variable = Expression.Variable(value.GetType()); @@ -128,7 +128,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("UnincrementableAndUndecrementableTypes")] + [MemberData(nameof(UnincrementableAndUndecrementableTypes))] public void InvalidOperandType(Type type) { ParameterExpression variable = Expression.Variable(type); diff --git a/src/System.Linq.Expressions/tests/Unary/UnboxTests.cs b/src/System.Linq.Expressions/tests/Unary/UnboxTests.cs index c5836f6ecd..bf254b9609 100644 --- a/src/System.Linq.Expressions/tests/Unary/UnboxTests.cs +++ b/src/System.Linq.Expressions/tests/Unary/UnboxTests.cs @@ -11,12 +11,12 @@ namespace System.Linq.Expressions.Tests public class UnboxTests { [Theory] - [MemberData("UnboxableFromObject")] - [MemberData("NullableUnboxableFromObject")] - [MemberData("UnboxableFromIComparable")] - [MemberData("NullableUnboxableFromIComparable")] - [MemberData("UnboxableFromIComparableT")] - [MemberData("NullableUnboxableFromIComparableT")] + [MemberData(nameof(UnboxableFromObject))] + [MemberData(nameof(NullableUnboxableFromObject))] + [MemberData(nameof(UnboxableFromIComparable))] + [MemberData(nameof(NullableUnboxableFromIComparable))] + [MemberData(nameof(UnboxableFromIComparableT))] + [MemberData(nameof(NullableUnboxableFromIComparableT))] public void CanUnbox(object value, Type type, Type boxedType) { Expression expression = Expression.Constant(value, boxedType); @@ -27,12 +27,12 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("UnboxableFromObject")] - [MemberData("NullableUnboxableFromObject")] - [MemberData("UnboxableFromIComparable")] - [MemberData("NullableUnboxableFromIComparable")] - [MemberData("UnboxableFromIComparableT")] - [MemberData("NullableUnboxableFromIComparableT")] + [MemberData(nameof(UnboxableFromObject))] + [MemberData(nameof(NullableUnboxableFromObject))] + [MemberData(nameof(UnboxableFromIComparable))] + [MemberData(nameof(NullableUnboxableFromIComparable))] + [MemberData(nameof(UnboxableFromIComparableT))] + [MemberData(nameof(NullableUnboxableFromIComparableT))] public void CanUnboxFromMake(object value, Type type, Type boxedType) { Expression expression = Expression.Constant(value, boxedType); @@ -117,7 +117,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("NullableTypes")] + [MemberData(nameof(NullableTypes))] public void NullNullable(Type type) { UnaryExpression unbox = Expression.Unbox(Expression.Default(typeof(object)), type); diff --git a/src/System.Linq.Expressions/tests/Variables/ParameterTests.cs b/src/System.Linq.Expressions/tests/Variables/ParameterTests.cs index 4638604c4e..d6195ada47 100644 --- a/src/System.Linq.Expressions/tests/Variables/ParameterTests.cs +++ b/src/System.Linq.Expressions/tests/Variables/ParameterTests.cs @@ -11,7 +11,7 @@ namespace System.Linq.Expressions.Tests public class ParameterTests : ParameterExpressionTests { [Theory] - [MemberData("ValidTypeData")] + [MemberData(nameof(ValidTypeData))] public void CreateParameterForValidTypeNoName(Type type) { ParameterExpression param = Expression.Parameter(type); @@ -21,7 +21,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ValidTypeData")] + [MemberData(nameof(ValidTypeData))] public void CrateParamForValidTypeWithName(Type type) { ParameterExpression param = Expression.Parameter(type, "name"); @@ -52,7 +52,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ByRefTypeData")] + [MemberData(nameof(ByRefTypeData))] public void ParameterCanBeByRef(Type type) { ParameterExpression param = Expression.Parameter(type); @@ -62,7 +62,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ByRefTypeData")] + [MemberData(nameof(ByRefTypeData))] public void NamedParameterCanBeByRef(Type type) { ParameterExpression param = Expression.Parameter(type, "name"); @@ -72,7 +72,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ValueData")] + [MemberData(nameof(ValueData))] public void CanWriteAndReadBack(object value) { Type type = value.GetType(); diff --git a/src/System.Linq.Expressions/tests/Variables/VariableTests.cs b/src/System.Linq.Expressions/tests/Variables/VariableTests.cs index 44aa060bd7..c578e3270b 100644 --- a/src/System.Linq.Expressions/tests/Variables/VariableTests.cs +++ b/src/System.Linq.Expressions/tests/Variables/VariableTests.cs @@ -11,7 +11,7 @@ namespace System.Linq.Expressions.Tests public class VariableTests : ParameterExpressionTests { [Theory] - [MemberData("ValidTypeData")] + [MemberData(nameof(ValidTypeData))] public void CreateVariableForValidTypeNoName(Type type) { ParameterExpression variable = Expression.Variable(type); @@ -21,7 +21,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ValidTypeData")] + [MemberData(nameof(ValidTypeData))] public void CrateVariableForValidTypeWithName(Type type) { ParameterExpression variable = Expression.Variable(type, "name"); @@ -52,7 +52,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ByRefTypeData")] + [MemberData(nameof(ByRefTypeData))] public void VariableCannotBeByRef(Type type) { Assert.Throws<ArgumentException>(() => Expression.Variable(type)); @@ -60,7 +60,7 @@ namespace System.Linq.Expressions.Tests } [Theory] - [MemberData("ValueData")] + [MemberData(nameof(ValueData))] public void CanWriteAndReadBack(object value) { Type type = value.GetType(); diff --git a/src/System.Linq.Parallel/tests/Combinatorial/CancellationParallelQueryCombinationTests.cs b/src/System.Linq.Parallel/tests/Combinatorial/CancellationParallelQueryCombinationTests.cs index 1f0656efd3..cdd0dc4824 100644 --- a/src/System.Linq.Parallel/tests/Combinatorial/CancellationParallelQueryCombinationTests.cs +++ b/src/System.Linq.Parallel/tests/Combinatorial/CancellationParallelQueryCombinationTests.cs @@ -10,8 +10,8 @@ namespace System.Linq.Parallel.Tests public partial class ParallelQueryCombinationTests { [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Aggregate_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -25,8 +25,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void All_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -36,8 +36,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Any_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -47,8 +47,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Average_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -58,8 +58,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Contains_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -69,8 +69,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Count_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -83,8 +83,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ElementAt_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -94,8 +94,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ElementAtOrDefault_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -106,8 +106,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void First_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -118,8 +118,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void FirstOrDefault_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -130,8 +130,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ForAll_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -141,8 +141,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Last_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -153,8 +153,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void LastOrDefault_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -165,8 +165,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Max_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -176,8 +176,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Min_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -187,8 +187,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SequenceEqual_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -199,8 +199,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Single_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -211,8 +211,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SingleOrDefault_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -223,8 +223,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Sum_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -234,8 +234,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ToArray_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -245,8 +245,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ToDictionary_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -257,8 +257,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ToList_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -268,8 +268,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ToLookup_OperationCanceledException_PreCanceled(LabeledOperation source, LabeledOperation operation) { CancellationTokenSource cs = new CancellationTokenSource(); diff --git a/src/System.Linq.Parallel/tests/Combinatorial/FailingParallelQueryCombinationTests.cs b/src/System.Linq.Parallel/tests/Combinatorial/FailingParallelQueryCombinationTests.cs index 4c265cc18f..eabd999f91 100644 --- a/src/System.Linq.Parallel/tests/Combinatorial/FailingParallelQueryCombinationTests.cs +++ b/src/System.Linq.Parallel/tests/Combinatorial/FailingParallelQueryCombinationTests.cs @@ -10,8 +10,8 @@ namespace System.Linq.Parallel.Tests public partial class ParallelQueryCombinationTests { [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void Aggregate_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).Aggregate((x, y) => x)); @@ -22,40 +22,40 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void All_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).All(x => true)); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void Any_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).Any(x => false)); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void Average_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).Average()); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void Contains_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).Contains(DefaultStart + DefaultSize)); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void Count_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).Count()); @@ -63,18 +63,18 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void ElementAt_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).ElementAt(DefaultSize - 1)); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void ElementAtOrDefault_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).ElementAtOrDefault(DefaultSize - 1)); @@ -82,17 +82,17 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void First_Predicate_None(LabeledOperation source, LabeledOperation operation) { Assert.Throws<InvalidOperationException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).First(x => false)); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void First_AggregateException(LabeledOperation source, LabeledOperation operation) { // Concat seems able to return the first element when the left query does not fail ("first" query). @@ -110,9 +110,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void FirstOrDefault_AggregateException(LabeledOperation source, LabeledOperation operation) { // Concat seems able to return the first element when the left query does not fail ("first" query). @@ -130,17 +130,17 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void ForAll_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).ForAll(x => { })); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void GetEnumerator_AggregateException(LabeledOperation source, LabeledOperation operation) { IEnumerator<int> enumerator = operation.Item(DefaultStart, DefaultSize, source.Item).GetEnumerator(); @@ -166,17 +166,17 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Last_Predicate_None(LabeledOperation source, LabeledOperation operation) { Assert.Throws<InvalidOperationException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).Last(x => false)); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void Last_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).Last()); @@ -184,9 +184,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void LastOrDefault_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).LastOrDefault()); @@ -194,8 +194,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void LongCount_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).LongCount()); @@ -203,25 +203,25 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void Max_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).Max()); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void Min_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).Min()); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void SequenceEqual_AggregateException(LabeledOperation source, LabeledOperation operation) { // Sequence equal double wraps queries that throw. @@ -240,8 +240,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void Single_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, 2, source.Item).Single()); @@ -249,8 +249,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void SingleOrDefault_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, 2, source.Item).SingleOrDefault()); @@ -258,26 +258,26 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] public static void Sum_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).Sum()); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void ToArray_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).ToArray()); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void ToDictionary_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).ToDictionary(x => x)); @@ -285,18 +285,18 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void ToList_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).ToList()); } [Theory] - [MemberData("UnaryFailingOperators")] - [MemberData("BinaryFailingOperators")] - [MemberData("OrderFailingOperators")] + [MemberData(nameof(UnaryFailingOperators))] + [MemberData(nameof(BinaryFailingOperators))] + [MemberData(nameof(OrderFailingOperators))] public static void ToLookup_AggregateException(LabeledOperation source, LabeledOperation operation) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => operation.Item(DefaultStart, DefaultSize, source.Item).ToLookup(x => x)); diff --git a/src/System.Linq.Parallel/tests/Combinatorial/ParallelQueryCombinationTests.cs b/src/System.Linq.Parallel/tests/Combinatorial/ParallelQueryCombinationTests.cs index 44292d85e8..93896a4531 100644 --- a/src/System.Linq.Parallel/tests/Combinatorial/ParallelQueryCombinationTests.cs +++ b/src/System.Linq.Parallel/tests/Combinatorial/ParallelQueryCombinationTests.cs @@ -10,8 +10,8 @@ namespace System.Linq.Parallel.Tests public partial class ParallelQueryCombinationTests { [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Aggregate(LabeledOperation source, LabeledOperation operation) { Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), @@ -19,8 +19,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Aggregate_Seed(LabeledOperation source, LabeledOperation operation) { Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), @@ -28,8 +28,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Aggregate_Result(LabeledOperation source, LabeledOperation operation) { Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), @@ -37,8 +37,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Aggregate_Accumulator(LabeledOperation source, LabeledOperation operation) { Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), @@ -46,8 +46,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Aggregate_SeedFactory(LabeledOperation source, LabeledOperation operation) { Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), @@ -55,16 +55,16 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void All_False(LabeledOperation source, LabeledOperation operation) { Assert.False(operation.Item(DefaultStart, DefaultSize, source.Item).All(x => false)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void All_True(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -73,8 +73,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Any_False(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -83,16 +83,16 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Any_True(LabeledOperation source, LabeledOperation operation) { Assert.True(operation.Item(DefaultStart, DefaultSize, source.Item).Any(x => true)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Average(LabeledOperation source, LabeledOperation operation) { Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize) / (double)DefaultSize, @@ -100,8 +100,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Average_Nullable(LabeledOperation source, LabeledOperation operation) { Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize) / (double?)DefaultSize, @@ -109,8 +109,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Cast(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -123,8 +123,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Cast_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -133,48 +133,48 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Contains_True(LabeledOperation source, LabeledOperation operation) { Assert.True(operation.Item(DefaultStart, DefaultSize, source.Item).Contains(DefaultStart + DefaultSize / 2)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Contains_False(LabeledOperation source, LabeledOperation operation) { Assert.False(operation.Item(DefaultStart, DefaultSize, source.Item).Contains(DefaultStart + DefaultSize)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Count_Elements(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultSize, operation.Item(DefaultStart, DefaultSize, source.Item).Count()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Count_Predicate_Some(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, source.Item).Count(x => x < DefaultStart + DefaultSize / 2)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Count_Predicate_None(LabeledOperation source, LabeledOperation operation) { Assert.Equal(0, operation.Item(DefaultStart, DefaultSize, source.Item).Count(x => x < DefaultStart)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void DefaultIfEmpty(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -186,8 +186,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void DefaultIfEmpty_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -196,8 +196,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Distinct(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -210,8 +210,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Distinct_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -221,8 +221,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ElementAt(LabeledOperation source, LabeledOperation operation) { ParallelQuery<int> query = operation.Item(DefaultStart, DefaultSize, source.Item); @@ -236,8 +236,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ElementAtOrDefault(LabeledOperation source, LabeledOperation operation) { ParallelQuery<int> query = operation.Item(DefaultStart, DefaultSize, source.Item); @@ -252,8 +252,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Except(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -267,8 +267,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Except_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -279,48 +279,48 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void First(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, source.Item).First()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void First_Predicate(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart + DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, source.Item).First(x => x >= DefaultStart + DefaultSize / 2)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void FirstOrDefault(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void FirstOrDefault_Predicate(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart + DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault(x => x >= DefaultStart + DefaultSize / 2)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void FirstOrDefault_Predicate_None(LabeledOperation source, LabeledOperation operation) { Assert.Equal(default(int), operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault(x => false)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ForAll(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -329,8 +329,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void GetEnumerator(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -348,8 +348,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void GroupBy(LabeledOperation source, LabeledOperation operation) { int seenKey = DefaultStart / GroupFactor; @@ -364,8 +364,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void GroupBy_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seenKey = DefaultStart / GroupFactor; @@ -380,8 +380,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void GroupBy_ElementSelector(LabeledOperation source, LabeledOperation operation) { int seenKey = DefaultStart / GroupFactor; @@ -396,8 +396,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void GroupBy_ElementSelector_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seenKey = DefaultStart / GroupFactor; @@ -412,8 +412,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Intersect(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -427,8 +427,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Intersect_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -439,104 +439,104 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Last(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, source.Item).Last()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Last_Predicate(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart + DefaultSize / 2 - 1, operation.Item(DefaultStart, DefaultSize, source.Item).Last(x => x < DefaultStart + DefaultSize / 2)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void LastOrDefault(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, source.Item).LastOrDefault()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void LastOrDefault_Predicate(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart + DefaultSize / 2 - 1, operation.Item(DefaultStart, DefaultSize, source.Item).LastOrDefault(x => x < DefaultStart + DefaultSize / 2)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void LastOrDefault_Predicate_None(LabeledOperation source, LabeledOperation operation) { Assert.Equal(default(int), operation.Item(DefaultStart, DefaultSize, source.Item).LastOrDefault(x => false)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void LongCount_Elements(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultSize, operation.Item(DefaultStart, DefaultSize, source.Item).LongCount()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void LongCount_Predicate_Some(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, source.Item).LongCount(x => x < DefaultStart + DefaultSize / 2)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void LongCount_Predicate_None(LabeledOperation source, LabeledOperation operation) { Assert.Equal(0, operation.Item(DefaultStart, DefaultSize, source.Item).LongCount(x => x < DefaultStart)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Max(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, source.Item).Max()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Max_Nullable(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, source.Item).Max(x => (int?)x)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Min(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, source.Item).Min()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Min_Nullable(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, source.Item).Min(x => (int?)x)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void OfType(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -548,8 +548,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void OfType_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -558,26 +558,26 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void OfType_Other(LabeledOperation source, LabeledOperation operation) { Assert.Empty(operation.Item(DefaultStart, DefaultSize, source.Item).OfType<long>()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void OfType_Other_NotPipelined(LabeledOperation source, LabeledOperation operation) { Assert.Empty(operation.Item(DefaultStart, DefaultSize, source.Item).OfType<long>().ToList()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void OrderBy_Initial(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -589,10 +589,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void OrderBy_Initial_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -601,10 +601,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void OrderBy_OtherDirection(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize; @@ -616,10 +616,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void OrderBy_OtherDirection_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize; @@ -628,10 +628,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void OrderByDescending_Initial(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -643,10 +643,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void OrderByDescending_Initial_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -655,10 +655,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void OrderByDescending_OtherDirection(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize; @@ -670,10 +670,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void OrderByDescending_OtherDirection_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize; @@ -682,8 +682,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Reverse(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize; @@ -695,8 +695,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Reverse_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize; @@ -708,8 +708,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Select(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -721,8 +721,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Select_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -731,8 +731,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Select_Indexed(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -744,8 +744,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Select_Indexed_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -754,8 +754,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SelectMany(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -767,8 +767,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SelectMany_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -777,8 +777,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SelectMany_Indexed(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -790,8 +790,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SelectMany_Indexed_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -800,8 +800,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SelectMany_ResultSelector(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -813,8 +813,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SelectMany_ResultSelector_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -823,8 +823,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SelectMany_Indexed_ResultSelector(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -836,8 +836,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SelectMany_Indexed_ResultSelector_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = -DefaultStart; @@ -846,8 +846,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SequenceEqual(LabeledOperation source, LabeledOperation operation) { Assert.True(operation.Item(DefaultStart, DefaultSize, source.Item).SequenceEqual(ParallelEnumerable.Range(DefaultStart, DefaultSize).AsOrdered())); @@ -855,18 +855,18 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SequenceEqual_Self(LabeledOperation source, LabeledOperation operation) { Assert.True(operation.Item(DefaultStart, DefaultSize, source.Item).SequenceEqual(operation.Item(DefaultStart, DefaultSize, source.Item))); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Single(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart, operation.Item(DefaultStart, 1, source.Item).Single()); @@ -874,10 +874,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void SingleOrDefault(LabeledOperation source, LabeledOperation operation) { Assert.Equal(DefaultStart, operation.Item(DefaultStart, 1, source.Item).SingleOrDefault()); @@ -891,8 +891,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Skip(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize / 2; @@ -904,8 +904,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Skip_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize / 2; @@ -914,8 +914,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SkipWhile(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize / 2; @@ -927,8 +927,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SkipWhile_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize / 2; @@ -937,8 +937,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SkipWhile_Indexed(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize / 2; @@ -950,8 +950,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void SkipWhile_Indexed_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize / 2; @@ -960,28 +960,28 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Sum(LabeledOperation source, LabeledOperation operation) { Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), operation.Item(DefaultStart, DefaultSize, source.Item).Sum()); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Sum_Nullable(LabeledOperation source, LabeledOperation operation) { Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), operation.Item(DefaultStart, DefaultSize, source.Item).Sum(x => (int?)x)); } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Take(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -993,8 +993,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Take_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1003,8 +1003,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void TakeWhile(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1016,8 +1016,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void TakeWhile_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1026,8 +1026,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void TakeWhile_Indexed(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1039,8 +1039,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void TakeWhile_Indexed_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1049,10 +1049,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ThenBy_Initial(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1064,10 +1064,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ThenBy_Initial_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1076,10 +1076,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ThenBy_OtherDirection(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize; @@ -1091,10 +1091,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ThenBy_OtherDirection_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize; @@ -1103,10 +1103,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ThenByDescending_Initial(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1118,10 +1118,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ThenByDescending_Initial_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1130,10 +1130,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ThenByDescending_OtherDirection(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize; @@ -1145,10 +1145,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ThenByDescending_OtherDirection_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart + DefaultSize; @@ -1157,8 +1157,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ToArray(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1167,10 +1167,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ToDictionary(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -1184,10 +1184,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ToDictionary_ElementSelector(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -1201,8 +1201,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void ToList(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1211,10 +1211,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ToLookup(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seenOuter = new IntegerRangeSet(0, 2); @@ -1232,10 +1232,10 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ToLookup_ElementSelector(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seenOuter = new IntegerRangeSet(0, 2); @@ -1253,8 +1253,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Where(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1266,8 +1266,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Where_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1276,8 +1276,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Where_Indexed(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1289,8 +1289,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Where_Indexed_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1299,8 +1299,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Zip(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; @@ -1314,8 +1314,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryOperators")] - [MemberData("BinaryOperators")] + [MemberData(nameof(UnaryOperators))] + [MemberData(nameof(BinaryOperators))] public static void Zip_NotPipelined(LabeledOperation source, LabeledOperation operation) { int seen = DefaultStart; diff --git a/src/System.Linq.Parallel/tests/Combinatorial/UnorderedParallelQueryCombinationTests.cs b/src/System.Linq.Parallel/tests/Combinatorial/UnorderedParallelQueryCombinationTests.cs index 4ab42222c1..8bac833d04 100644 --- a/src/System.Linq.Parallel/tests/Combinatorial/UnorderedParallelQueryCombinationTests.cs +++ b/src/System.Linq.Parallel/tests/Combinatorial/UnorderedParallelQueryCombinationTests.cs @@ -10,8 +10,8 @@ namespace System.Linq.Parallel.Tests public partial class ParallelQueryCombinationTests { [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Cast_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -24,8 +24,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Cast_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -34,8 +34,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void DefaultIfEmpty_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -47,8 +47,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void DefaultIfEmpty_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -57,8 +57,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Distinct_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -71,8 +71,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Distinct_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -82,8 +82,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Except_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -97,8 +97,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Except_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -109,8 +109,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void GetEnumerator_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -127,8 +127,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void GroupBy_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seenKey = new IntegerRangeSet(DefaultStart / GroupFactor, (DefaultSize + (GroupFactor - 1)) / GroupFactor); @@ -143,8 +143,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void GroupBy_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seenKey = new IntegerRangeSet(DefaultStart / GroupFactor, (DefaultSize + (GroupFactor - 1)) / GroupFactor); @@ -159,8 +159,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void GroupBy_ElementSelector_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seenKey = new IntegerRangeSet(DefaultStart / GroupFactor, (DefaultSize + (GroupFactor - 1)) / GroupFactor); @@ -175,8 +175,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void GroupBy_ElementSelector_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seenKey = new IntegerRangeSet(DefaultStart / GroupFactor, (DefaultSize + (GroupFactor - 1)) / GroupFactor); @@ -191,8 +191,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Intersect_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -206,8 +206,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Intersect_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -218,8 +218,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void OfType_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -231,8 +231,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void OfType_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -241,8 +241,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Select_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize + 1, DefaultSize); @@ -254,8 +254,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Select_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize + 1, DefaultSize); @@ -264,8 +264,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Select_Index_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize + 1, DefaultSize); @@ -279,8 +279,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Select_Index_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize + 1, DefaultSize); @@ -291,8 +291,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void SelectMany_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize * 2 + 1, DefaultSize * 2); @@ -304,8 +304,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void SelectMany_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize * 2 + 1, DefaultSize * 2); @@ -314,8 +314,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void SelectMany_Indexed_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize * 2 + 1, DefaultSize * 2); @@ -329,8 +329,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void SelectMany_Indexed_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize * 2 + 1, DefaultSize * 2); @@ -341,8 +341,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void SelectMany_ResultSelector_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize * 2 + 1, DefaultSize * 2); @@ -354,8 +354,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void SelectMany_ResultSelector_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize * 2 + 1, DefaultSize * 2); @@ -364,8 +364,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void SelectMany_Indexed_ResultSelector_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize * 2 + 1, DefaultSize * 2); @@ -379,8 +379,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void SelectMany_Indexed_ResultSelector_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(-DefaultStart - DefaultSize * 2 + 1, DefaultSize * 2); @@ -391,8 +391,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Skip_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -406,8 +406,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Skip_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -417,8 +417,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Take_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -432,8 +432,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Take_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -443,8 +443,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void ToArray_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -453,8 +453,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Where_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize / 2); @@ -466,8 +466,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Where_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize / 2); @@ -476,8 +476,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Where_Indexed_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize / 2); @@ -489,8 +489,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Where_Indexed_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize / 2); @@ -499,8 +499,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Zip_Unordered(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); @@ -514,8 +514,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("UnaryUnorderedOperators")] - [MemberData("BinaryUnorderedOperators")] + [MemberData(nameof(UnaryUnorderedOperators))] + [MemberData(nameof(BinaryUnorderedOperators))] public static void Zip_Unordered_NotPipelined(LabeledOperation source, LabeledOperation operation) { IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize); diff --git a/src/System.Linq.Parallel/tests/DegreeOfParallelismTests.cs b/src/System.Linq.Parallel/tests/DegreeOfParallelismTests.cs index 4b77057273..c2fd627b01 100644 --- a/src/System.Linq.Parallel/tests/DegreeOfParallelismTests.cs +++ b/src/System.Linq.Parallel/tests/DegreeOfParallelismTests.cs @@ -44,7 +44,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("DegreeData", new[] { 1024 }, new[] { 1, 4, 512 })] + [MemberData(nameof(DegreeData), new[] { 1024 }, new[] { 1, 4, 512 })] [OuterLoop] public static void DegreeOfParallelism(Labeled<ParallelQuery<int>> labeled, int count, int degree) { @@ -52,7 +52,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("DegreeData", new[] { 1, 4, 32 }, new int[] { })] + [MemberData(nameof(DegreeData), new[] { 1, 4, 32 }, new int[] { })] [OuterLoop] public static void DegreeOfParallelism_Barrier(Labeled<ParallelQuery<int>> labeled, int count, int degree) { @@ -70,7 +70,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("DegreeData", new[] { 128 * 1024 }, new[] { 1, 4, 64, 512 })] + [MemberData(nameof(DegreeData), new[] { 128 * 1024 }, new[] { 1, 4, 64, 512 })] [OuterLoop] public static void DegreeOfParallelism_Pipelining(Labeled<ParallelQuery<int>> labeled, int count, int degree) { @@ -78,11 +78,11 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("DegreeData", new[] { 1, 4 }, new int[] { })] - [MemberData("DegreeData", new[] { 32 }, new[] { 4 })] + [MemberData(nameof(DegreeData), new[] { 1, 4 }, new int[] { })] + [MemberData(nameof(DegreeData), new[] { 32 }, new[] { 4 })] // Without the ability to ask the thread pool to create a minimum number of threads ahead of time, // higher thread counts take a prohibitive amount of time spooling them up. - //[MemberData("DegreeSourceData", new[] { 64, 512 }, new object[] { })] + //[MemberData(nameof(DegreeSourceData), new[] { 64, 512 }, new object[] { })] [OuterLoop] public static void DegreeOfParallelism_Throttled_Pipelining(Labeled<ParallelQuery<int>> labeled, int count, int degree) { @@ -99,8 +99,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("NotLoadBalancedDegreeData", new[] { 1, 4 }, new int[] { })] - [MemberData("NotLoadBalancedDegreeData", new[] { 32, 512, 1024 }, new[] { 4, 16 })] + [MemberData(nameof(NotLoadBalancedDegreeData), new[] { 1, 4 }, new int[] { })] + [MemberData(nameof(NotLoadBalancedDegreeData), new[] { 32, 512, 1024 }, new[] { 4, 16 })] [OuterLoop] public static void DegreeOfParallelism_Aggregate_Accumulator(Labeled<ParallelQuery<int>> labeled, int count, int degree) { @@ -117,8 +117,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("NotLoadBalancedDegreeData", new[] { 1, 4 }, new int[] { })] - [MemberData("NotLoadBalancedDegreeData", new[] { 32, 512, 1024 }, new[] { 4, 16 })] + [MemberData(nameof(NotLoadBalancedDegreeData), new[] { 1, 4 }, new int[] { })] + [MemberData(nameof(NotLoadBalancedDegreeData), new[] { 32, 512, 1024 }, new[] { 4, 16 })] [OuterLoop] public static void DegreeOfParallelism_Aggregate_SeedFunction(Labeled<ParallelQuery<int>> labeled, int count, int degree) { @@ -138,7 +138,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("DegreeData", new[] { 1024 }, new[] { 0, 513 })] + [MemberData(nameof(DegreeData), new[] { 1024 }, new[] { 0, 513 })] [OuterLoop] public static void DegreeOfParallelism_OutOfRange(Labeled<ParallelQuery<int>> labeled, int count, int degree) { diff --git a/src/System.Linq.Parallel/tests/ExchangeTests.cs b/src/System.Linq.Parallel/tests/ExchangeTests.cs index 382d64fa82..79ef6d2276 100644 --- a/src/System.Linq.Parallel/tests/ExchangeTests.cs +++ b/src/System.Linq.Parallel/tests/ExchangeTests.cs @@ -89,7 +89,7 @@ namespace System.Linq.Parallel.Tests // or WithMergeOptions [Theory] - [MemberData("PartitioningData", (object)(new int[] { 0, 1, 2, 16, 1024 }))] + [MemberData(nameof(PartitioningData), (object)(new int[] { 0, 1, 2, 16, 1024 }))] public static void Partitioning_Default(Labeled<ParallelQuery<int>> labeled, int count, int partitions) { int seen = 0; @@ -101,14 +101,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("PartitioningData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(PartitioningData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void Partitioning_Default_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int partitions) { Partitioning_Default(labeled, count, partitions); } [Theory] - [MemberData("PartitioningData", (object)(new int[] { 0, 1, 2, 16, 1024 }))] + [MemberData(nameof(PartitioningData), (object)(new int[] { 0, 1, 2, 16, 1024 }))] public static void Partitioning_Striped(Labeled<ParallelQuery<int>> labeled, int count, int partitions) { int seen = 0; @@ -120,14 +120,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("PartitioningData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(PartitioningData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void Partitioning_Striped_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int partitions) { Partitioning_Striped(labeled, count, partitions); } [Theory] - [MemberData("MergeData", (object)(new int[] { 0, 1, 2, 16, 1024 }))] + [MemberData(nameof(MergeData), (object)(new int[] { 0, 1, 2, 16, 1024 }))] public static void Merge_Ordered(Labeled<ParallelQuery<int>> labeled, int count, ParallelMergeOptions options) { int seen = 0; @@ -139,14 +139,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MergeData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(MergeData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void Merge_Ordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, ParallelMergeOptions options) { Merge_Ordered(labeled, count, options); } [Theory] - [MemberData("ThrowOnCount_AllMergeOptions_MemberData", (object)(new int[] { 4, 8 }))] + [MemberData(nameof(ThrowOnCount_AllMergeOptions_MemberData), (object)(new int[] { 4, 8 }))] // FailingMergeData has enumerables that throw errors when attempting to perform the nth enumeration. // This test checks whether the query runs in a pipelined or buffered fashion. public static void Merge_Ordered_Pipelining(Labeled<ParallelQuery<int>> labeled, int count, ParallelMergeOptions options) @@ -155,7 +155,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MergeData", (object)(new int[] { 4, 8 }))] + [MemberData(nameof(MergeData), (object)(new int[] { 4, 8 }))] // This test checks whether the query runs in a pipelined or buffered fashion. public static void Merge_Ordered_Pipelining_Select(Labeled<ParallelQuery<int>> labeled, int count, ParallelMergeOptions options) { @@ -169,7 +169,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Merge_ArgumentException(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -178,7 +178,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AllMergeOptions_Multiple")] + [MemberData(nameof(AllMergeOptions_Multiple))] public static void WithMergeOptions_Multiple(ParallelMergeOptions first, ParallelMergeOptions second) { Assert.Throws<InvalidOperationException>(() => ParallelEnumerable.Range(0, 1).WithMergeOptions(first).WithMergeOptions(second)); @@ -195,7 +195,7 @@ namespace System.Linq.Parallel.Tests // the source enumerator... but then other worker threads may generate ODEs. // This test verifies any such ODEs are not reflected in the output exception. [Theory] - [MemberData("BinaryRanges", new int[] { 16 }, new int[] { 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 16 }, new int[] { 16 }, MemberType = typeof(UnorderedSources))] public static void PlinqChunkPartitioner_DontEnumerateAfterException(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { @@ -215,7 +215,7 @@ namespace System.Linq.Parallel.Tests // enumerator disposes the source enumerator... but then other worker threads may generate ODEs. // This test verifies any such ODEs are not reflected in the output exception. [Theory] - [MemberData("BinaryRanges", new int[] { 16 }, new int[] { 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 16 }, new int[] { 16 }, MemberType = typeof(UnorderedSources))] public static void ManualChunkPartitioner_DontEnumerateAfterException( Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) diff --git a/src/System.Linq.Parallel/tests/ParallelEnumerableTests.cs b/src/System.Linq.Parallel/tests/ParallelEnumerableTests.cs index 7e8e4581a5..71b29e8cb6 100644 --- a/src/System.Linq.Parallel/tests/ParallelEnumerableTests.cs +++ b/src/System.Linq.Parallel/tests/ParallelEnumerableTests.cs @@ -51,7 +51,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("RangeData")] + [MemberData(nameof(RangeData))] public static void Range_UndefinedOrder(int start, int count) { ParallelQuery<int> query = ParallelEnumerable.Range(start, count); @@ -62,7 +62,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("RangeData")] + [MemberData(nameof(RangeData))] public static void Range_AsOrdered(int start, int count) { ParallelQuery<int> query = ParallelEnumerable.Range(start, count).AsOrdered(); @@ -73,7 +73,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("RangeData")] + [MemberData(nameof(RangeData))] public static void Range_AsSequential(int start, int count) { IEnumerable<int> query = ParallelEnumerable.Range(start, count).AsSequential(); @@ -84,7 +84,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("RangeData")] + [MemberData(nameof(RangeData))] public static void Range_First(int start, int count) { ParallelQuery<int> query = ParallelEnumerable.Range(start, count); @@ -100,7 +100,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("RangeData")] + [MemberData(nameof(RangeData))] public static void Range_FirstOrDefault(int start, int count) { ParallelQuery<int> query = ParallelEnumerable.Range(start, count); @@ -109,7 +109,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("RangeData")] + [MemberData(nameof(RangeData))] public static void Range_Last(int start, int count) { ParallelQuery<int> query = ParallelEnumerable.Range(start, count); @@ -125,7 +125,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("RangeData")] + [MemberData(nameof(RangeData))] public static void Range_LastOrDefault(int start, int count) { ParallelQuery<int> query = ParallelEnumerable.Range(start, count); @@ -134,7 +134,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("RangeData")] + [MemberData(nameof(RangeData))] public static void Range_Take(int start, int count) { ParallelQuery<int> query = ParallelEnumerable.Range(start, count).Take(count / 2); @@ -146,7 +146,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("RangeData")] + [MemberData(nameof(RangeData))] public static void Range_Skip(int start, int count) { ParallelQuery<int> query = ParallelEnumerable.Range(start, count).Skip(count / 2); @@ -188,7 +188,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("RepeatData")] + [MemberData(nameof(RepeatData))] public static void Repeat<T>(T element, int count) { ParallelQuery<T> query = ParallelEnumerable.Repeat(element, count); @@ -223,7 +223,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("EmptyData")] + [MemberData(nameof(EmptyData))] public static void Empty<T>(T def) { Assert.Empty(ParallelEnumerable.Empty<T>()); diff --git a/src/System.Linq.Parallel/tests/PlinqModesTests.cs b/src/System.Linq.Parallel/tests/PlinqModesTests.cs index 5099320dea..39c9f3f4a6 100644 --- a/src/System.Linq.Parallel/tests/PlinqModesTests.cs +++ b/src/System.Linq.Parallel/tests/PlinqModesTests.cs @@ -137,7 +137,7 @@ namespace System.Linq.Parallel.Tests // Check that some queries run in parallel by default, and some require forcing. [Theory] - [MemberData("WithExecutionModeQueryData", new int[] { 1, 4 })] // DOP of 1 to verify sequential and 4 to verify parallel + [MemberData(nameof(WithExecutionModeQueryData), new int[] { 1, 4 })] // DOP of 1 to verify sequential and 4 to verify parallel public static void WithExecutionMode( Labeled<ParallelQuery<int>> labeled, int requestedDop, int expectedDop, @@ -150,7 +150,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void WithExecutionMode_ArgumentException(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -158,7 +158,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AllExecutionModes_Multiple")] + [MemberData(nameof(AllExecutionModes_Multiple))] public static void WithExecutionMode_Multiple(ParallelExecutionMode first, ParallelExecutionMode second) { Assert.Throws<InvalidOperationException>(() => ParallelEnumerable.Range(0, 1).WithExecutionMode(first).WithExecutionMode(second)); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/AggregateTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/AggregateTests.cs index 35cc98ffa7..81955a17ae 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/AggregateTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/AggregateTests.cs @@ -34,7 +34,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Sum(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -52,14 +52,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Sum_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Aggregate_Sum(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Sum_Seed(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -68,14 +68,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Sum_Seed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Aggregate_Sum_Seed(labeled, count); } [Theory] - [MemberData("Ranges", 1, new int[] { 0, 1, 2, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), 1, new int[] { 0, 1, 2, 16 }, MemberType = typeof(UnorderedSources))] public static void Aggregate_Product_Seed(Labeled<ParallelQuery<int>> labeled, int count, int start) { ParallelQuery<int> query = labeled.Item; @@ -86,14 +86,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", 1, new int[] { 1024 * 1024, 1024 * 1024 * 4 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), 1, new int[] { 1024 * 1024, 1024 * 1024 * 4 }, MemberType = typeof(UnorderedSources))] public static void Aggregate_Product_Seed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int start) { Aggregate_Product_Seed(labeled, count, start); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Collection_Seed(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -102,14 +102,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 512, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 512, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Collection_Seed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Aggregate_Collection_Seed(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Sum_Result(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -118,14 +118,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Sum_Result_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Aggregate_Sum_Result(labeled, count); } [Theory] - [MemberData("Ranges", 1, new int[] { 0, 1, 2, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), 1, new int[] { 0, 1, 2, 16 }, MemberType = typeof(UnorderedSources))] public static void Aggregate_Product_Result(Labeled<ParallelQuery<int>> labeled, int count, int start) { ParallelQuery<int> query = labeled.Item; @@ -134,14 +134,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", 1, new int[] { 1024 * 1024, 1024 * 1024 * 4 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), 1, new int[] { 1024 * 1024, 1024 * 1024 * 4 }, MemberType = typeof(UnorderedSources))] public static void Aggregate_Product_Results_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int start) { Aggregate_Product_Result(labeled, count, start); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Collection_Results(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -150,14 +150,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 512, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 512, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Collection_Results_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Aggregate_Collection_Results(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Sum_Accumulator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -171,14 +171,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Sum_Accumulator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Aggregate_Sum_Accumulator(labeled, count); } [Theory] - [MemberData("Ranges", 1, new int[] { 0, 1, 2, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), 1, new int[] { 0, 1, 2, 16 }, MemberType = typeof(UnorderedSources))] public static void Aggregate_Product_Accumulator(Labeled<ParallelQuery<int>> labeled, int count, int start) { ParallelQuery<int> query = labeled.Item; @@ -192,14 +192,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", 1, new int[] { 1024 * 1024, 1024 * 1024 * 4 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), 1, new int[] { 1024 * 1024, 1024 * 1024 * 4 }, MemberType = typeof(UnorderedSources))] public static void Aggregate_Product_Accumulator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int start) { Aggregate_Product_Accumulator(labeled, count, start); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Collection_Accumulator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -213,14 +213,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 512, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 512, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Collection_Accumulator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Aggregate_Collection_Accumulator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Sum_SeedFunction(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -234,14 +234,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Sum_SeedFunction_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Aggregate_Sum_SeedFunction(labeled, count); } [Theory] - [MemberData("Ranges", 1, new int[] { 0, 1, 2, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), 1, new int[] { 0, 1, 2, 16 }, MemberType = typeof(UnorderedSources))] public static void Aggregate_Product_SeedFunction(Labeled<ParallelQuery<int>> labeled, int count, int start) { ParallelQuery<int> query = labeled.Item; @@ -255,14 +255,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", 1, new int[] { 1024 * 1024, 1024 * 1024 * 4 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), 1, new int[] { 1024 * 1024, 1024 * 1024 * 4 }, MemberType = typeof(UnorderedSources))] public static void Aggregate_Product_SeedFunction_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int start) { Aggregate_Product_SeedFunction(labeled, count, start); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Collection_SeedFunction(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -276,7 +276,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 512, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 512, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_Collection_SeedFunction_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Aggregate_Collection_SeedFunction(labeled, count); @@ -294,7 +294,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Aggregate_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -307,7 +307,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AggregateExceptionData", (object)(new int[] { 2 }))] + [MemberData(nameof(AggregateExceptionData), (object)(new int[] { 2 }))] public static void Aggregate_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.Aggregate((i, j) => { throw new DeliberateTestException(); })); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/AllTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/AllTests.cs index 72ff6a401a..1aae54a6ad 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/AllTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/AllTests.cs @@ -20,7 +20,7 @@ namespace System.Linq.Parallel.Tests // All // [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void All_AllFalse(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -29,14 +29,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void All_AllFalse_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { All_AllFalse(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void All_AllTrue(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -47,14 +47,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void All_AllTrue_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { All_AllTrue(labeled, count); } [Theory] - [MemberData("OnlyOneData", (object)(new int[] { 2, 16 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 2, 16 }))] public static void All_OneFalse(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -63,14 +63,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("OnlyOneData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void All_OneFalse_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { All_OneFalse(labeled, count, position); } [Theory] - [MemberData("OnlyOneData", (object)(new int[] { 2, 16 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 2, 16 }))] public static void All_OneTrue(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -79,14 +79,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("OnlyOneData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void All_OneTrue_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { All_OneTrue(labeled, count, position); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void All_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -96,7 +96,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void All_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.All(x => { throw new DeliberateTestException(); })); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/AnyTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/AnyTests.cs index 39d3b1b936..3d51b46c8c 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/AnyTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/AnyTests.cs @@ -20,7 +20,7 @@ namespace System.Linq.Parallel.Tests // Any // [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Any_Contents(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -29,14 +29,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Any_Contents_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Any_Contents(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Any_AllFalse(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -47,14 +47,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Any_AllFalse_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Any_AllFalse(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Any_AllTrue(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -63,14 +63,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Any_AllTrue_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Any_AllTrue(labeled, count); } [Theory] - [MemberData("OnlyOneData", (object)(new int[] { 2, 16 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 2, 16 }))] public static void Any_OneFalse(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -79,14 +79,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("OnlyOneData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void Any_OneFalse_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { Any_OneFalse(labeled, count, position); } [Theory] - [MemberData("OnlyOneData", (object)(new int[] { 2, 16 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 2, 16 }))] public static void Any_OneTrue(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -95,7 +95,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("OnlyOneData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void Any_OneTrue_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { Any_OneTrue(labeled, count, position); @@ -112,7 +112,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Any_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -123,7 +123,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Any_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.Any(x => { throw new DeliberateTestException(); })); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/AsEnumerableTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/AsEnumerableTests.cs index 589e77e0b6..50d8fcc70f 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/AsEnumerableTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/AsEnumerableTests.cs @@ -10,7 +10,7 @@ namespace System.Linq.Parallel.Tests public class AsEnumerableTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void AsEnumerable_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { IntegerRangeSet seen = new IntegerRangeSet(0, count); @@ -21,14 +21,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void AsEnumerable_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { AsEnumerable_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void AsEnumerable(Labeled<ParallelQuery<int>> labeled, int count) { int seen = 0; @@ -39,7 +39,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(Sources))] public static void AsEnumerable_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { AsEnumerable(labeled, count); @@ -47,7 +47,7 @@ namespace System.Linq.Parallel.Tests [Theory] [ActiveIssue("AsEnumerable.Cast<T>() retains origin type")] - [MemberData("Ranges", (object)(new int[] { 0, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 16 }), MemberType = typeof(Sources))] public static void AsEnumerable_LinqBinding(Labeled<ParallelQuery<int>> labeled, int count) { IEnumerable<int> enumerable = labeled.Item.AsEnumerable(); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/AsSequentialTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/AsSequentialTests.cs index fd8dd3d6c9..9d351b605f 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/AsSequentialTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/AsSequentialTests.cs @@ -10,7 +10,7 @@ namespace System.Linq.Parallel.Tests public class AsSequentialTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void AsSequential_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { IntegerRangeSet seen = new IntegerRangeSet(0, count); @@ -21,14 +21,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void AsSequential_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { AsSequential_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void AsSequential(Labeled<ParallelQuery<int>> labeled, int count) { int seen = 0; @@ -39,7 +39,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(Sources))] public static void AsSequential_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { AsSequential(labeled, count); @@ -47,7 +47,7 @@ namespace System.Linq.Parallel.Tests [Theory] [ActiveIssue("AsSequential.Cast<T>() retains origin type")] - [MemberData("Ranges", (object)(new int[] { 0, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 16 }), MemberType = typeof(Sources))] public static void AsSequential_LinqBinding(Labeled<ParallelQuery<int>> labeled, int count) { IEnumerable<int> seq = labeled.Item.AsSequential(); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/AverageTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/AverageTests.cs index 3187d4bfa1..179e48f07a 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/AverageTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/AverageTests.cs @@ -22,7 +22,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Int(Labeled<ParallelQuery<int>> labeled, int count, double average) { ParallelQuery<int> query = labeled.Item; @@ -34,14 +34,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("AverageData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void Average_Int_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, double average) { Average_Int(labeled, count, average); } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Int_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, double average) { ParallelQuery<int> query = labeled.Item; @@ -50,7 +50,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Int_AllNull(Labeled<ParallelQuery<int>> labeled, int count, double average) { ParallelQuery<int> query = labeled.Item; @@ -59,7 +59,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Long(Labeled<ParallelQuery<int>> labeled, int count, double average) { ParallelQuery<int> query = labeled.Item; @@ -71,14 +71,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("AverageData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void Average_Long_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, double average) { Average_Long(labeled, count, average); } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Average_Long_Overflow(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<OverflowException>(() => labeled.Item.Select(x => x == 0 ? 1 : long.MaxValue).Average()); @@ -88,7 +88,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Long_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, double average) { ParallelQuery<int> query = labeled.Item; @@ -97,7 +97,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Long_AllNull(Labeled<ParallelQuery<int>> labeled, int count, double average) { ParallelQuery<int> query = labeled.Item; @@ -106,7 +106,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Float(Labeled<ParallelQuery<int>> labeled, int count, float average) { ParallelQuery<int> query = labeled.Item; @@ -118,14 +118,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("AverageData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void Average_Float_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, float average) { Average_Float(labeled, count, average); } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Float_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, float average) { ParallelQuery<int> query = labeled.Item; @@ -134,7 +134,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Float_AllNull(Labeled<ParallelQuery<int>> labeled, int count, float average) { ParallelQuery<int> query = labeled.Item; @@ -143,7 +143,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Double(Labeled<ParallelQuery<int>> labeled, int count, double average) { ParallelQuery<int> query = labeled.Item; @@ -155,14 +155,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("AverageData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void Average_Double_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, double average) { Average_Double(labeled, count, average); } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Double_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, double average) { ParallelQuery<int> query = labeled.Item; @@ -171,7 +171,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Double_AllNull(Labeled<ParallelQuery<int>> labeled, int count, double average) { ParallelQuery<int> query = labeled.Item; @@ -180,7 +180,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Decimal(Labeled<ParallelQuery<int>> labeled, int count, decimal average) { ParallelQuery<int> query = labeled.Item; @@ -192,14 +192,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("AverageData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void Average_Decimal_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, decimal average) { Average_Decimal(labeled, count, average); } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Decimal_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, decimal average) { ParallelQuery<int> query = labeled.Item; @@ -208,7 +208,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("AverageData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(AverageData), (object)(new int[] { 1, 2, 16 }))] public static void Average_Decimal_AllNull(Labeled<ParallelQuery<int>> labeled, int count, decimal average) { ParallelQuery<int> query = labeled.Item; @@ -243,7 +243,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Average_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -266,7 +266,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Average_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.Average((Func<int, int>)(x => { throw new DeliberateTestException(); }))); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/CastTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/CastTests.cs index 2f189b0f95..dc2554c0ed 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/CastTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/CastTests.cs @@ -9,7 +9,7 @@ namespace System.Linq.Parallel.Tests public class CastTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Cast_Unordered_Valid(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -23,14 +23,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] public static void Cast_Unordered_Valid_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Cast_Unordered_Valid(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] public static void Cast_Valid(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -44,14 +44,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] public static void Cast_Valid_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Cast_Valid(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Cast_Unordered_Valid_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -62,14 +62,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] public static void Cast_Unordered_Valid_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Cast_Unordered_Valid_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] public static void Cast_Valid_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -80,15 +80,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] public static void Cast_Valid_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Cast_Valid(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0 }), MemberType = typeof(UnorderedSources))] - [MemberData("Ranges", (object)(new int[] { 0 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0 }), MemberType = typeof(Sources))] public static void Cast_Empty(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> empty = labeled.Item; @@ -99,8 +99,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] public static void Cast_InvalidCastException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<InvalidCastException>(() => labeled.Item.Cast<double>().ForAll(x => {; })); @@ -108,8 +108,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] public static void Cast_Assignable_InvalidCastException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<InvalidCastException>(() => labeled.Item.Select(x => (Int32)x).Cast<Castable>().ForAll(x => {; })); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ConcatTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ConcatTests.cs index ea9f1b084a..9112bfa77f 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ConcatTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ConcatTests.cs @@ -29,7 +29,7 @@ namespace System.Linq.Parallel.Tests // Concat // [Theory] - [MemberData("ConcatUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ConcatUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Concat_Unordered(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -44,14 +44,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ConcatUnorderedData", (object)(new int[] { 1024, 1024 * 16 }))] + [MemberData(nameof(ConcatUnorderedData), (object)(new int[] { 1024, 1024 * 16 }))] public static void Concat_Unordered_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Concat_Unordered(left, leftCount, right, rightCount); } [Theory] - [MemberData("ConcatData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ConcatData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Concat(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -66,14 +66,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ConcatData", (object)(new int[] { 1024, 1024 * 16 }))] + [MemberData(nameof(ConcatData), (object)(new int[] { 1024, 1024 * 16 }))] public static void Concat_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Concat(left, leftCount, right, rightCount); } [Theory] - [MemberData("ConcatUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ConcatUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Concat_Unordered_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -85,14 +85,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ConcatUnorderedData", (object)(new int[] { 1024, 1024 * 16 }))] + [MemberData(nameof(ConcatUnorderedData), (object)(new int[] { 1024, 1024 * 16 }))] public static void Concat_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Concat_Unordered_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("ConcatData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ConcatData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Concat_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -104,7 +104,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ConcatData", (object)(new int[] { 1024, 1024 * 16 }))] + [MemberData(nameof(ConcatData), (object)(new int[] { 1024, 1024 * 16 }))] public static void Concat_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Concat_NotPipelined(left, leftCount, right, rightCount); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ContainsTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ContainsTests.cs index c141de84c6..7932fc493f 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ContainsTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ContainsTests.cs @@ -20,8 +20,8 @@ namespace System.Linq.Parallel.Tests // Contains // [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void Contains_NoMatching(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -32,16 +32,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] public static void Contains_NoMatching_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Contains_NoMatching(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 16 }), MemberType = typeof(UnorderedSources))] - [MemberData("Ranges", (object)(new int[] { 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 16 }), MemberType = typeof(Sources))] public static void Contains_MultipleMatching(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -50,15 +50,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] public static void Contains_MultipleMatching_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Contains_MultipleMatching(labeled, count); } [Theory] - [MemberData("OnlyOneData", (object)(new int[] { 2, 16 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 2, 16 }))] public static void Contains_OneMatching(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -69,14 +69,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("OnlyOneData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void Contains_OneMatching_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { Contains_OneMatching(labeled, count, position); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Contains_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -87,7 +87,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Contains_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.Contains(1, new FailingEqualityComparer<int>())); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/CountLongCountTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/CountLongCountTests.cs index 68bff9c2a2..a94d660a04 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/CountLongCountTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/CountLongCountTests.cs @@ -20,8 +20,8 @@ namespace System.Linq.Parallel.Tests // Count and LongCount // [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Count_All(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -31,16 +31,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Count_All_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Count_All(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void LongCount_All(Labeled<ParallelQuery<int>> labeled, long count) { ParallelQuery<int> query = labeled.Item; @@ -50,16 +50,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void LongCount_All_Longrunning(Labeled<ParallelQuery<int>> labeled, long count) { LongCount_All(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Count_None(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -68,16 +68,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Count_None_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Count_None(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void LongCount_None(Labeled<ParallelQuery<int>> labeled, long count) { ParallelQuery<int> query = labeled.Item; @@ -86,15 +86,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void LongCount_None_Longrunning(Labeled<ParallelQuery<int>> labeled, long count) { LongCount_None(labeled, count); } [Theory] - [MemberData("OnlyOneData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Count_One(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -103,14 +103,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("OnlyOneData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void Count_One_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { Count_One(labeled, count, position); } [Theory] - [MemberData("OnlyOneData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 0, 1, 2, 16 }))] public static void LongCount_One(Labeled<ParallelQuery<int>> labeled, int count, long position) { ParallelQuery<int> query = labeled.Item; @@ -119,14 +119,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("OnlyOneData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(OnlyOneData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void LongCount_One_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, long position) { LongCount_One(labeled, count, position); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void CountLongCount_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -140,7 +140,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void CountLongCount_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.Count(x => { throw new DeliberateTestException(); })); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/DefaultIfEmptyTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/DefaultIfEmptyTests.cs index 3a61aa9af3..dd6355144d 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/DefaultIfEmptyTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/DefaultIfEmptyTests.cs @@ -24,7 +24,7 @@ namespace System.Linq.Parallel.Tests // DefaultIfEmpty // [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void DefaultIfEmpty_Unordered_NotEmpty(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -38,14 +38,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] public static void DefaultIfEmpty_Unordered_NotEmpty_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { DefaultIfEmpty_Unordered_NotEmpty(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] public static void DefaultIfEmpty_NotEmpty(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -59,14 +59,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] public static void DefaultIfEmpty_NotEmpty_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { DefaultIfEmpty_NotEmpty(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void DefaultIfEmpty_Unordered_NotEmpty_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -77,14 +77,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] public static void DefaultIfEmpty_Unordered_NotEmpty_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { DefaultIfEmpty_Unordered_NotEmpty_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] public static void DefaultIfEmpty_NotEmpty_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -98,14 +98,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] public static void DefaultIfEmpty_NotEmpty_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { DefaultIfEmpty_NotEmpty_NotPipelined(labeled, count); } [Theory] - [MemberData("EmptyData")] + [MemberData(nameof(EmptyData))] public static void DefaultIfEmpty_Empty<T>(Labeled<ParallelQuery<T>> labeled, T def) { ParallelQuery<T> notEmpty = labeled.Item.DefaultIfEmpty(); @@ -120,7 +120,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("EmptyData")] + [MemberData(nameof(EmptyData))] public static void DefaultIfEmpty_Empty_NotPipelined<T>(Labeled<ParallelQuery<T>> labeled, T def) { IList<T> notEmpty = labeled.Item.DefaultIfEmpty().ToList(); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/DistinctTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/DistinctTests.cs index 887609489c..cab74c5898 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/DistinctTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/DistinctTests.cs @@ -39,7 +39,7 @@ namespace System.Linq.Parallel.Tests // Distinct // [Theory] - [MemberData("DistinctUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(DistinctUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Distinct_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -53,14 +53,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("DistinctUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 128 }))] + [MemberData(nameof(DistinctUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 128 }))] public static void Distinct_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Distinct_Unordered(labeled, count); } [Theory] - [MemberData("DistinctData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(DistinctData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Distinct(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -74,14 +74,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("DistinctData", (object)(new int[] { 1024 * 4, 1024 * 128 }))] + [MemberData(nameof(DistinctData), (object)(new int[] { 1024 * 4, 1024 * 128 }))] public static void Distinct_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Distinct(labeled, count); } [Theory] - [MemberData("DistinctUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(DistinctUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Distinct_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -92,14 +92,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("DistinctUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 128 }))] + [MemberData(nameof(DistinctUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 128 }))] public static void Distinct_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Distinct_Unordered_NotPipelined(labeled, count); } [Theory] - [MemberData("DistinctData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(DistinctData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Distinct_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -110,14 +110,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("DistinctData", (object)(new int[] { 1024 * 4, 1024 * 128 }))] + [MemberData(nameof(DistinctData), (object)(new int[] { 1024 * 4, 1024 * 128 }))] public static void Distinct_NotPiplined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Distinct_NotPipelined(labeled, count); } [Theory] - [MemberData("DistinctSourceMultipleData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(DistinctSourceMultipleData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Distinct_Unordered_SourceMultiple(ParallelQuery<int> query, int count) { // The difference between this test and the previous, is that it's not possible to @@ -131,14 +131,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("DistinctSourceMultipleData", (object)(new int[] { 1024 * 4, 1024 * 128 }))] + [MemberData(nameof(DistinctSourceMultipleData), (object)(new int[] { 1024 * 4, 1024 * 128 }))] public static void Distinct_Unordered_SourceMultiple_Longrunning(ParallelQuery<int> query, int count) { Distinct_Unordered_SourceMultiple(query, count); } [Theory] - [MemberData("DistinctSourceMultipleData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(DistinctSourceMultipleData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Distinct_SourceMultiple(ParallelQuery<int> query, int count) { int seen = 0; @@ -148,7 +148,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("DistinctSourceMultipleData", (object)(new int[] { 1024 * 4, 1024 * 128 }))] + [MemberData(nameof(DistinctSourceMultipleData), (object)(new int[] { 1024 * 4, 1024 * 128 }))] public static void Distinct_SourceMultiple_Longrunning(ParallelQuery<int> query, int count) { Distinct_SourceMultiple(query, count); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ElementAtElementAtOrDefaultTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ElementAtElementAtOrDefaultTests.cs index 929b7fe9f4..c2a77740f0 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ElementAtElementAtOrDefaultTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ElementAtElementAtOrDefaultTests.cs @@ -32,8 +32,8 @@ namespace System.Linq.Parallel.Tests // ElementAt and ElementAtOrDefault // [Theory] - [MemberData("ElementAtUnorderedData", (object)(new int[] { 1, 2, 16 }))] - [MemberData("ElementAtData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(ElementAtUnorderedData), (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(ElementAtData), (object)(new int[] { 1, 2, 16 }))] public static void ElementAt(Labeled<ParallelQuery<int>> labeled, int count, int position) { // For unordered collections, which element is chosen isn't actually guaranteed, but an effect of the implementation. @@ -44,15 +44,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ElementAtUnorderedData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] - [MemberData("ElementAtData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(ElementAtUnorderedData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(ElementAtData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void ElementAt_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { ElementAt(labeled, count, position); } [Theory] - [MemberData("ElementAtOutOfRangeData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ElementAtOutOfRangeData), (object)(new int[] { 0, 1, 2, 16 }))] public static void ElementAt_OutOfRange(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -61,15 +61,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ElementAtOutOfRangeData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(ElementAtOutOfRangeData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void ElementAt_OutOfRange_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { ElementAt_OutOfRange(labeled, count, position); } [Theory] - [MemberData("ElementAtUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] - [MemberData("ElementAtData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ElementAtUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ElementAtData), (object)(new int[] { 0, 1, 2, 16 }))] public static void ElementAtOrDefault(Labeled<ParallelQuery<int>> labeled, int count, int position) { // For unordered collections, which element is chosen isn't actually guaranteed, but an effect of the implementation. @@ -80,15 +80,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ElementAtUnorderedData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] - [MemberData("ElementAtData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(ElementAtUnorderedData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(ElementAtData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void ElementAtOrDefault_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { ElementAtOrDefault(labeled, count, position); } [Theory] - [MemberData("ElementAtOutOfRangeData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ElementAtOutOfRangeData), (object)(new int[] { 0, 1, 2, 16 }))] public static void ElementAtOrDefault_OutOfRange(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -97,14 +97,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ElementAtOutOfRangeData", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] + [MemberData(nameof(ElementAtOutOfRangeData), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }))] public static void ElementAtOrDefault_OutOfRange_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { ElementAtOrDefault_OutOfRange(labeled, count, position); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void ElementAt_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ExceptTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ExceptTests.cs index 7f2f94515e..5e7f2e9621 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ExceptTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ExceptTests.cs @@ -48,7 +48,7 @@ namespace System.Linq.Parallel.Tests // Except // [Theory] - [MemberData("ExceptUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(ExceptUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Except_Unordered(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -63,14 +63,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ExceptUnorderedData", new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] + [MemberData(nameof(ExceptUnorderedData), new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] public static void Except_Unordered_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { Except_Unordered(left, leftCount, right, rightCount, start, count); } [Theory] - [MemberData("ExceptData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(ExceptData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Except(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -85,14 +85,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ExceptData", new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] + [MemberData(nameof(ExceptData), new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] public static void Except_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { Except(left, leftCount, right, rightCount, start, count); } [Theory] - [MemberData("ExceptUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(ExceptUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Except_Unordered_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -104,14 +104,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ExceptUnorderedData", new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] + [MemberData(nameof(ExceptUnorderedData), new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] public static void Except_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { Except_Unordered_NotPipelined(left, leftCount, right, rightCount, start, count); } [Theory] - [MemberData("ExceptData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(ExceptData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Except_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -123,14 +123,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ExceptData", new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] + [MemberData(nameof(ExceptData), new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] public static void Except_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { Except_NotPipelined(left, leftCount, right, rightCount, start, count); } [Theory] - [MemberData("ExceptUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(ExceptUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Except_Unordered_Distinct(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -148,14 +148,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ExceptUnorderedData", new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] + [MemberData(nameof(ExceptUnorderedData), new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] public static void Except_Unordered_Distinct_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { Except_Unordered_Distinct(left, leftCount, right, rightCount, start, count); } [Theory] - [MemberData("ExceptData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(ExceptData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Except_Distinct(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -173,14 +173,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ExceptData", new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] + [MemberData(nameof(ExceptData), new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] public static void Except_Distinct_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { Except_Distinct(left, leftCount, right, rightCount, start, count); } [Theory] - [MemberData("ExceptUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(ExceptUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Except_Unordered_Distinct_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -196,14 +196,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ExceptData", new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] + [MemberData(nameof(ExceptData), new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] public static void Except_Unordered_Distinct_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { Except_Unordered_Distinct_NotPipelined(left, leftCount, right, rightCount, start, count); } [Theory] - [MemberData("ExceptData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(ExceptData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Except_Distinct_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -219,14 +219,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ExceptData", new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] + [MemberData(nameof(ExceptData), new int[] { 1024, 1024 * 16 }, new int[] { 0, 1024, 1024 * 32 })] public static void Except_Distinct_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int start, int count) { Except_Distinct_NotPipelined(left, leftCount, right, rightCount, start, count); } [Theory] - [MemberData("ExceptSourceMultipleData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ExceptSourceMultipleData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Except_Unordered_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int start, int count) { // The difference between this test and the previous, is that it's not possible to @@ -240,14 +240,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ExceptSourceMultipleData", (object)(new int[] { 1024, 1024 * 16 }))] + [MemberData(nameof(ExceptSourceMultipleData), (object)(new int[] { 1024, 1024 * 16 }))] public static void Except_Unordered_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int start, int count) { Except_Unordered_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, start, count); } [Theory] - [MemberData("ExceptSourceMultipleData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ExceptSourceMultipleData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Except_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int start, int count) { int seen = start; @@ -257,7 +257,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ExceptSourceMultipleData", (object)(new int[] { 1024, 1024 * 16 }))] + [MemberData(nameof(ExceptSourceMultipleData), (object)(new int[] { 1024, 1024 * 16 }))] public static void Except_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int start, int count) { Except_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, start, count); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/FirstFirstOrDefaultTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/FirstFirstOrDefaultTests.cs index 6f8ca0426a..84da68a2f3 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/FirstFirstOrDefaultTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/FirstFirstOrDefaultTests.cs @@ -26,8 +26,8 @@ namespace System.Linq.Parallel.Tests // First and FirstOrDefault // [Theory] - [MemberData("FirstUnorderedData", (object)(new int[] { 1, 2, 16 }))] - [MemberData("FirstData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(FirstUnorderedData), (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(FirstData), (object)(new int[] { 1, 2, 16 }))] public static void First(Labeled<ParallelQuery<int>> labeled, int count, int position) { // For unordered collections, which element is chosen isn't actually guaranteed, but an effect of the implementation. @@ -39,16 +39,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("FirstUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] - [MemberData("FirstData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(FirstUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(FirstData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void First_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { First(labeled, count, position); } [Theory] - [MemberData("FirstUnorderedData", (object)(new int[] { 1, 2, 16 }))] - [MemberData("FirstData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(FirstUnorderedData), (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(FirstData), (object)(new int[] { 1, 2, 16 }))] public static void FirstOrDefault(Labeled<ParallelQuery<int>> labeled, int count, int position) { // For unordered collections, which element is chosen isn't actually guaranteed, but an effect of the implementation. @@ -60,16 +60,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("FirstUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] - [MemberData("FirstData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(FirstUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(FirstData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void FirstOrDefault_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { FirstOrDefault(labeled, count, position); } [Theory] - [MemberData("FirstUnorderedData", (object)(new int[] { 0 }))] - [MemberData("FirstData", (object)(new int[] { 0 }))] + [MemberData(nameof(FirstUnorderedData), (object)(new int[] { 0 }))] + [MemberData(nameof(FirstData), (object)(new int[] { 0 }))] public static void First_Empty(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -77,8 +77,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("FirstUnorderedData", (object)(new int[] { 0 }))] - [MemberData("FirstData", (object)(new int[] { 0 }))] + [MemberData(nameof(FirstUnorderedData), (object)(new int[] { 0 }))] + [MemberData(nameof(FirstData), (object)(new int[] { 0 }))] public static void FirstOrDefault_Empty(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -86,8 +86,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("FirstUnorderedData", (object)(new int[] { 1, 2, 16 }))] - [MemberData("FirstData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(FirstUnorderedData), (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(FirstData), (object)(new int[] { 0, 1, 2, 16 }))] public static void First_NoMatch(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -98,16 +98,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("FirstUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] - [MemberData("FirstData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(FirstUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(FirstData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void First_NoMatch_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { First_NoMatch(labeled, count, position); } [Theory] - [MemberData("FirstUnorderedData", (object)(new int[] { 1, 2, 16 }))] - [MemberData("FirstData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(FirstUnorderedData), (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(FirstData), (object)(new int[] { 0, 1, 2, 16 }))] public static void FirstOrDefault_NoMatch(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -118,15 +118,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("FirstUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] - [MemberData("FirstData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(FirstUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(FirstData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void FirstOrDefault_NoMatch_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { FirstOrDefault_NoMatch(labeled, count, position); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void First_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -140,7 +140,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void First_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.First(x => { throw new DeliberateTestException(); })); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ForAllTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ForAllTests.cs index 451b8f157c..5b893ddf3d 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ForAllTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ForAllTests.cs @@ -10,8 +10,8 @@ namespace System.Linq.Parallel.Tests public class ForAllTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ForAll(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -22,15 +22,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 1024, 1024 * 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void ForAll_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ForAll(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void ForAll_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -40,7 +40,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void ForAll_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.ForAll(x => { throw new DeliberateTestException(); })); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs index 1aee2f0a89..c2a41a557d 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs @@ -10,7 +10,7 @@ namespace System.Linq.Parallel.Tests public class GetEnumeratorTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void GetEnumerator_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { IntegerRangeSet seen = new IntegerRangeSet(0, count); @@ -41,14 +41,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] public static void GetEnumerator_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GetEnumerator_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void GetEnumerator(Labeled<ParallelQuery<int>> labeled, int count) { int seen = 0; @@ -79,14 +79,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(Sources))] public static void GetEnumerator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GetEnumerator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void GetEnumerator_MoveNextAfterQueryOpeningFailsIsIllegal(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item.Select<int, int>(x => { throw new DeliberateTestException(); }).OrderBy(x => x); @@ -101,8 +101,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 16 }), MemberType = typeof(UnorderedSources))] - [MemberData("Ranges", (object)(new int[] { 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 16 }), MemberType = typeof(Sources))] public static void GetEnumerator_CurrentBeforeMoveNext(Labeled<ParallelQuery<int>> labeled, int count) { IEnumerator<int> enumerator = labeled.Item.GetEnumerator(); @@ -118,8 +118,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void GetEnumerator_MoveNextAfterEnd(Labeled<ParallelQuery<int>> labeled, int count) { IEnumerator<int> enumerator = labeled.Item.GetEnumerator(); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/GroupByTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/GroupByTests.cs index 1f4c5119b9..9d21c6fe26 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/GroupByTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/GroupByTests.cs @@ -12,7 +12,7 @@ namespace System.Linq.Parallel.Tests private const int GroupFactor = 8; [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -34,14 +34,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] public static void GroupBy(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -63,14 +63,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] public static void GroupBy_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -88,14 +88,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_Unordered_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] public static void GroupBy_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -113,14 +113,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] public static void GroupBy_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -142,14 +142,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_Unordered_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] // GroupBy doesn't select the first 'identical' key. Issue #1490 public static void GroupBy_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { @@ -172,14 +172,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] public static void GroupBy_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_ElementSelector(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -198,14 +198,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_ElementSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_Unordered_ElementSelector(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] public static void GroupBy_ElementSelector(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -223,14 +223,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] public static void GroupBy_ElementSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_ElementSelector(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_ElementSelector_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -249,14 +249,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_ElementSelector_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_Unordered_ElementSelector_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] public static void GroupBy_ElementSelector_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -274,14 +274,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] public static void GroupBy_ElementSelector_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_ElementSelector_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_ResultSelector(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -298,14 +298,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_ResultSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_Unordered_ResultSelector(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] public static void GroupBy_ResultSelector(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -322,14 +322,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] public static void GroupBy_ResultSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_ResultSelector(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 7, 8, 15, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 7, 8, 15, 16 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_ResultSelector_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -346,14 +346,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_ResultSelector_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_Unordered_ResultSelector_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] public static void GroupBy_ResultSelector_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -370,14 +370,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] public static void GroupBy_ResultSelector_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_ResultSelector_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 7, 8, 15, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 7, 8, 15, 16 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_ElementSelector_ResultSelector(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -395,14 +395,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void GroupBy_Unordered_ElementSelector_ResultSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_Unordered_ElementSelector_ResultSelector(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, GroupFactor - 1, GroupFactor, GroupFactor * 2 - 1, GroupFactor * 2 }), MemberType = typeof(Sources))] public static void GroupBy_ElementSelector_ResultSelector(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -419,7 +419,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 16 }), MemberType = typeof(Sources))] public static void GroupBy_ElementSelector_ResultSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { GroupBy_ElementSelector_ResultSelector(labeled, count); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs index 9645648876..e0beb156e2 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs @@ -25,7 +25,7 @@ namespace System.Linq.Parallel.Tests // GroupJoin // [Theory] - [MemberData("BinaryRanges", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] public static void GroupJoin_Unordered(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -48,14 +48,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("BinaryRanges", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 }, MemberType = typeof(UnorderedSources))] public static void GroupJoin_Unordered_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { GroupJoin_Unordered(left, leftCount, right, rightCount); } [Theory] - [MemberData("GroupJoinData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] + [MemberData(nameof(GroupJoinData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] public static void GroupJoin(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -78,14 +78,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("GroupJoinData", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 })] + [MemberData(nameof(GroupJoinData), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 })] public static void GroupJoin_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { GroupJoin(left, leftCount, right, rightCount); } [Theory] - [MemberData("BinaryRanges", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] public static void GroupJoin_Unordered_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -109,14 +109,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("BinaryRanges", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 }, MemberType = typeof(UnorderedSources))] public static void GroupJoin_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { GroupJoin_Unordered_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("GroupJoinData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] + [MemberData(nameof(GroupJoinData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] public static void GroupJoin_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -140,14 +140,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("GroupJoinData", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 })] + [MemberData(nameof(GroupJoinData), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 })] public static void GroupJoin_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { GroupJoin_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("BinaryRanges", new int[] { 0, 1, 2, 15, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 0, 1, 2, 15, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] public static void GroupJoin_Unordered_Multiple(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -173,14 +173,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("BinaryRanges", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 }, MemberType = typeof(UnorderedSources))] public static void GroupJoin_Unordered_Multiple_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { GroupJoin_Unordered_Multiple(left, leftCount, right, rightCount); } [Theory] - [MemberData("GroupJoinData", new int[] { 0, 1, 2, 15, 16 }, new int[] { 0, 1, 16 })] + [MemberData(nameof(GroupJoinData), new int[] { 0, 1, 2, 15, 16 }, new int[] { 0, 1, 16 })] // GroupJoin doesn't always return elements from the right in order. See Issue #1155 public static void GroupJoin_Multiple(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { @@ -207,14 +207,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("GroupJoinData", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 })] + [MemberData(nameof(GroupJoinData), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 4, 1024 * 8 })] public static void GroupJoin_Multiple_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { GroupJoin_Multiple(left, leftCount, right, rightCount); } [Theory] - [MemberData("BinaryRanges", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] public static void GroupJoin_Unordered_CustomComparator(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -240,14 +240,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("BinaryRanges", new int[] { 512, 1024 }, new int[] { 0, 1, 1024, 1024 * 4 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 512, 1024 }, new int[] { 0, 1, 1024, 1024 * 4 }, MemberType = typeof(UnorderedSources))] public static void GroupJoin_Unordered_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { GroupJoin_Unordered_CustomComparator(left, leftCount, right, rightCount); } [Theory] - [MemberData("GroupJoinData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] + [MemberData(nameof(GroupJoinData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] public static void GroupJoin_CustomComparator(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -273,7 +273,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("GroupJoinData", new int[] { 512, 1024 }, new int[] { 0, 1, 1024, 1024 * 4 })] + [MemberData(nameof(GroupJoinData), new int[] { 512, 1024 }, new int[] { 0, 1, 1024, 1024 * 4 })] public static void GroupJoin_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { GroupJoin_CustomComparator(left, leftCount, right, rightCount); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/IntersectTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/IntersectTests.cs index b43dfc9589..c3306a8766 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/IntersectTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/IntersectTests.cs @@ -48,7 +48,7 @@ namespace System.Linq.Parallel.Tests // Intersect // [Theory] - [MemberData("IntersectUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(IntersectUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Intersect_Unordered(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -63,14 +63,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("IntersectUnorderedData", new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] + [MemberData(nameof(IntersectUnorderedData), new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] public static void Intersect_Unordered_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { Intersect_Unordered(left, leftCount, right, rightCount, count); } [Theory] - [MemberData("IntersectData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(IntersectData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Intersect(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -85,14 +85,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("IntersectData", new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] + [MemberData(nameof(IntersectData), new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] public static void Intersect_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { Intersect(left, leftCount, right, rightCount, count); } [Theory] - [MemberData("IntersectUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(IntersectUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Intersect_Unordered_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -104,14 +104,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("IntersectUnorderedData", new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] + [MemberData(nameof(IntersectUnorderedData), new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] public static void Intersect_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { Intersect_Unordered_NotPipelined(left, leftCount, right, rightCount, count); } [Theory] - [MemberData("IntersectData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(IntersectData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Intersect_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -123,14 +123,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("IntersectData", new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] + [MemberData(nameof(IntersectData), new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] public static void Intersect_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { Intersect_NotPipelined(left, leftCount, right, rightCount, count); } [Theory] - [MemberData("IntersectUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(IntersectUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Intersect_Unordered_Distinct(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -147,14 +147,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("IntersectUnorderedData", new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] + [MemberData(nameof(IntersectUnorderedData), new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] public static void Intersect_Unordered_Distinct_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { Intersect_Unordered_Distinct(left, leftCount, right, rightCount, count); } [Theory] - [MemberData("IntersectData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(IntersectData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Intersect_Distinct(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -171,14 +171,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("IntersectData", new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] + [MemberData(nameof(IntersectData), new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] public static void Intersect_Distinct_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { Intersect_Distinct(left, leftCount, right, rightCount, count); } [Theory] - [MemberData("IntersectUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(IntersectUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Intersect_Unordered_Distinct_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -192,14 +192,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("IntersectUnorderedData", new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] + [MemberData(nameof(IntersectUnorderedData), new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] public static void Intersect_Unordered_Distinct_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { Intersect_Unordered_Distinct_NotPipelined(left, leftCount, right, rightCount, count); } [Theory] - [MemberData("IntersectData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(IntersectData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Intersect_Distinct_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -213,14 +213,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("IntersectData", new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] + [MemberData(nameof(IntersectData), new int[] { 512, 1024 * 16 }, new int[] { 0, 1, 512, 1024 * 32 })] public static void Intersect_Distinct_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int count) { Intersect_Distinct_NotPipelined(left, leftCount, right, rightCount, count); } [Theory] - [MemberData("IntersectSourceMultipleData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(IntersectSourceMultipleData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Intersect_Unordered_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { // The difference between this test and the previous, is that it's not possible to @@ -234,14 +234,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("IntersectSourceMultipleData", (object)(new int[] { 512, 1024 * 16 }))] + [MemberData(nameof(IntersectSourceMultipleData), (object)(new int[] { 512, 1024 * 16 }))] public static void Intersect_Unordered_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { Intersect_Unordered_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, count); } [Theory] - [MemberData("IntersectSourceMultipleData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(IntersectSourceMultipleData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Intersect_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { int seen = 0; @@ -251,7 +251,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("IntersectSourceMultipleData", (object)(new int[] { 512, 1024 * 16 }))] + [MemberData(nameof(IntersectSourceMultipleData), (object)(new int[] { 512, 1024 * 16 }))] public static void Intersect_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { Intersect_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, count); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs index e221e52a4e..9cd6dc2089 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs @@ -24,7 +24,7 @@ namespace System.Linq.Parallel.Tests // Join // [Theory] - [MemberData("BinaryRanges", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] public static void Join_Unordered(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -40,14 +40,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("BinaryRanges", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 }, MemberType = typeof(UnorderedSources))] public static void Join_Unordered_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Join_Unordered(left, leftCount, right, rightCount); } [Theory] - [MemberData("JoinData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] + [MemberData(nameof(JoinData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] public static void Join(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -63,14 +63,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("JoinData", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 })] + [MemberData(nameof(JoinData), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 })] public static void Join_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Join(left, leftCount, right, rightCount); } [Theory] - [MemberData("BinaryRanges", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] public static void Join_Unordered_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -83,14 +83,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("BinaryRanges", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 }, MemberType = typeof(UnorderedSources))] public static void Join_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Join_Unordered_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("JoinData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] + [MemberData(nameof(JoinData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] public static void Join_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -103,14 +103,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("JoinData", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 })] + [MemberData(nameof(JoinData), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 })] public static void Join_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Join_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("BinaryRanges", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] public static void Join_Unordered_Multiple(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -130,14 +130,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("BinaryRanges", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 }, MemberType = typeof(UnorderedSources))] public static void Join_Unordered_Multiple_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Join_Unordered_Multiple(left, leftCount, right, rightCount); } [Theory] - [MemberData("JoinData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] + [MemberData(nameof(JoinData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] // Join doesn't always return items from the right ordered. See Issue #1155 public static void Join_Multiple(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { @@ -165,14 +165,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("JoinData", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 })] + [MemberData(nameof(JoinData), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 })] public static void Join_Multiple_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Join_Multiple(left, leftCount, right, rightCount); } [Theory] - [MemberData("BinaryRanges", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 }, MemberType = typeof(UnorderedSources))] public static void Join_Unordered_CustomComparator(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -202,14 +202,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("BinaryRanges", new int[] { 512, 1024 }, new int[] { 0, 1, 1024 }, MemberType = typeof(UnorderedSources))] + [MemberData(nameof(UnorderedSources.BinaryRanges), new int[] { 512, 1024 }, new int[] { 0, 1, 1024 }, MemberType = typeof(UnorderedSources))] public static void Join_Unordered_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Join_Unordered_CustomComparator(left, leftCount, right, rightCount); } [Theory] - [MemberData("JoinData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] + [MemberData(nameof(JoinData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] public static void Join_CustomComparator(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -239,14 +239,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("JoinData", new int[] { 512, 1024 }, new int[] { 0, 1, 1024 })] + [MemberData(nameof(JoinData), new int[] { 512, 1024 }, new int[] { 0, 1, 1024 })] public static void Join_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Join_CustomComparator(left, leftCount, right, rightCount); } [Theory] - [MemberData("JoinData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] + [MemberData(nameof(JoinData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 16 })] public static void Join_InnerJoin_Ordered(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -268,7 +268,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("JoinData", new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 })] + [MemberData(nameof(JoinData), new int[] { 1024 * 4, 1024 * 8 }, new int[] { 0, 1, 1024 * 8, 1024 * 16 })] public static void Join_InnerJoin_Ordered_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Join_InnerJoin_Ordered(left, leftCount, right, rightCount); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/LastLastOrDefaultTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/LastLastOrDefaultTests.cs index 225cac1766..35345ad5e1 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/LastLastOrDefaultTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/LastLastOrDefaultTests.cs @@ -26,8 +26,8 @@ namespace System.Linq.Parallel.Tests // Last and LastOrDefault // [Theory] - [MemberData("LastUnorderedData", (object)(new int[] { 1, 2, 16 }))] - [MemberData("LastData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(LastUnorderedData), (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(LastData), (object)(new int[] { 1, 2, 16 }))] public static void Last(Labeled<ParallelQuery<int>> labeled, int count, int position) { // For unordered collections, which element is chosen isn't actually guaranteed, but an effect of the implementation. @@ -39,16 +39,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("LastUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] - [MemberData("LastData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(LastUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(LastData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void Last_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { Last(labeled, count, position); } [Theory] - [MemberData("LastUnorderedData", (object)(new int[] { 1, 2, 16 }))] - [MemberData("LastData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(LastUnorderedData), (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(LastData), (object)(new int[] { 1, 2, 16 }))] public static void LastOrDefault(Labeled<ParallelQuery<int>> labeled, int count, int position) { // For unordered collections, which element is chosen isn't actually guaranteed, but an effect of the implementation. @@ -60,16 +60,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("LastUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] - [MemberData("LastData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(LastUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(LastData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void LastOrDefault_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { LastOrDefault(labeled, count, position); } [Theory] - [MemberData("LastUnorderedData", (object)(new int[] { 0 }))] - [MemberData("LastData", (object)(new int[] { 0 }))] + [MemberData(nameof(LastUnorderedData), (object)(new int[] { 0 }))] + [MemberData(nameof(LastData), (object)(new int[] { 0 }))] public static void Last_Empty(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -77,8 +77,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("LastUnorderedData", (object)(new int[] { 0 }))] - [MemberData("LastData", (object)(new int[] { 0 }))] + [MemberData(nameof(LastUnorderedData), (object)(new int[] { 0 }))] + [MemberData(nameof(LastData), (object)(new int[] { 0 }))] public static void LastOrDefault_Empty(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -86,8 +86,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("LastUnorderedData", (object)(new int[] { 1, 2, 16 }))] - [MemberData("LastData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(LastUnorderedData), (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(LastData), (object)(new int[] { 1, 2, 16 }))] public static void Last_NoMatch(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -98,16 +98,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("LastUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] - [MemberData("LastData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(LastUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(LastData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void Last_NoMatch_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { Last_NoMatch(labeled, count, position); } [Theory] - [MemberData("LastUnorderedData", (object)(new int[] { 1, 2, 16 }))] - [MemberData("LastData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(LastUnorderedData), (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(LastData), (object)(new int[] { 1, 2, 16 }))] public static void LastOrDefault_NoMatch(Labeled<ParallelQuery<int>> labeled, int count, int position) { ParallelQuery<int> query = labeled.Item; @@ -118,15 +118,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("LastUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] - [MemberData("LastData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(LastUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(LastData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void LastOrDefault_NoMatch_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int position) { LastOrDefault_NoMatch(labeled, count, position); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Last_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -140,7 +140,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Last_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.Last(x => { throw new DeliberateTestException(); })); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/MaxTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/MaxTests.cs index b778fb08e4..08cc8ef8e2 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/MaxTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/MaxTests.cs @@ -25,7 +25,7 @@ namespace System.Linq.Parallel.Tests // [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Int(Labeled<ParallelQuery<int>> labeled, int count, int max) { ParallelQuery<int> query = labeled.Item; @@ -37,14 +37,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MaxData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Max_Int_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int max) { Max_Int(labeled, count, max); } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Int_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, int max) { ParallelQuery<int> query = labeled.Item; @@ -53,7 +53,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Int_AllNull(Labeled<ParallelQuery<int>> labeled, int count, int max) { ParallelQuery<int> query = labeled.Item; @@ -62,7 +62,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Long(Labeled<ParallelQuery<int>> labeled, int count, long max) { ParallelQuery<int> query = labeled.Item; @@ -74,14 +74,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MaxData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Max_Long_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, long max) { Max_Long(labeled, count, max); } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Long_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, long max) { ParallelQuery<int> query = labeled.Item; @@ -90,7 +90,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Long_AllNull(Labeled<ParallelQuery<int>> labeled, int count, long max) { ParallelQuery<int> query = labeled.Item; @@ -99,7 +99,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Float(Labeled<ParallelQuery<int>> labeled, int count, float max) { ParallelQuery<int> query = labeled.Item; @@ -113,14 +113,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MaxData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Max_Float_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, float max) { Max_Float(labeled, count, max); } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Float_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, float max) { ParallelQuery<int> query = labeled.Item; @@ -129,7 +129,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Float_AllNull(Labeled<ParallelQuery<int>> labeled, int count, float max) { ParallelQuery<int> query = labeled.Item; @@ -138,7 +138,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Double(Labeled<ParallelQuery<int>> labeled, int count, double max) { ParallelQuery<int> query = labeled.Item; @@ -152,14 +152,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MaxData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Max_Double_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, double max) { Max_Double(labeled, count, max); } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Double_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, double max) { ParallelQuery<int> query = labeled.Item; @@ -168,7 +168,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Double_AllNull(Labeled<ParallelQuery<int>> labeled, int count, double max) { ParallelQuery<int> query = labeled.Item; @@ -177,7 +177,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Decimal(Labeled<ParallelQuery<int>> labeled, int count, decimal max) { ParallelQuery<int> query = labeled.Item; @@ -189,14 +189,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MaxData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Max_Decimal_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, decimal max) { Max_Decimal(labeled, count, max); } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Decimal_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, decimal max) { ParallelQuery<int> query = labeled.Item; @@ -205,7 +205,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Decimal_AllNull(Labeled<ParallelQuery<int>> labeled, int count, decimal max) { ParallelQuery<int> query = labeled.Item; @@ -214,7 +214,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Other(Labeled<ParallelQuery<int>> labeled, int count, int max) { ParallelQuery<int> query = labeled.Item; @@ -224,14 +224,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MaxData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Max_Other_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int max) { Max_Other(labeled, count, max); } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, }))] public static void Max_NotComparable(Labeled<ParallelQuery<int>> labeled, int count, int max) { NotComparable a = new NotComparable(0); @@ -239,7 +239,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Other_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, int max) { ParallelQuery<int> query = labeled.Item; @@ -248,7 +248,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MaxData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MaxData), (object)(new int[] { 1, 2, 16 }))] public static void Max_Other_AllNull(Labeled<ParallelQuery<int>> labeled, int count, int max) { ParallelQuery<int> query = labeled.Item; @@ -257,7 +257,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0 }), MemberType = typeof(UnorderedSources))] public static void Max_EmptyNullable(Labeled<ParallelQuery<int>> labeled, int count) { Assert.Null(labeled.Item.Max(x => (int?)x)); @@ -269,7 +269,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0 }), MemberType = typeof(UnorderedSources))] public static void Max_InvalidOperationException(Labeled<ParallelQuery<int>> labeled, int count) { Assert.Throws<InvalidOperationException>(() => labeled.Item.Max()); @@ -281,7 +281,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Max_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -306,7 +306,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Max_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.Max((Func<int, int>)(x => { throw new DeliberateTestException(); }))); @@ -328,7 +328,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Max_AggregateException_NotComparable(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<ArgumentException>(() => labeled.Item.Max(x => new NotComparable(x))); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/MinTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/MinTests.cs index 85720ccd84..e9ecf4c817 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/MinTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/MinTests.cs @@ -24,7 +24,7 @@ namespace System.Linq.Parallel.Tests // Min // [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Int(Labeled<ParallelQuery<int>> labeled, int count, int min) { ParallelQuery<int> query = labeled.Item; @@ -36,14 +36,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MinData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Min_Int_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int min) { Min_Int(labeled, count, min); } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Int_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, int min) { ParallelQuery<int> query = labeled.Item; @@ -52,7 +52,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Int_AllNull(Labeled<ParallelQuery<int>> labeled, int count, int min) { ParallelQuery<int> query = labeled.Item; @@ -61,7 +61,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Long(Labeled<ParallelQuery<int>> labeled, int count, long min) { ParallelQuery<int> query = labeled.Item; @@ -73,14 +73,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MinData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Min_Long_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, long min) { Min_Long(labeled, count, min); } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Long_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, long min) { ParallelQuery<int> query = labeled.Item; @@ -89,7 +89,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Long_AllNull(Labeled<ParallelQuery<int>> labeled, int count, long min) { ParallelQuery<int> query = labeled.Item; @@ -98,7 +98,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Float(Labeled<ParallelQuery<int>> labeled, int count, float min) { ParallelQuery<int> query = labeled.Item; @@ -114,14 +114,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MinData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Min_Float_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, float min) { Min_Float(labeled, count, min); } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Float_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, float min) { ParallelQuery<int> query = labeled.Item; @@ -130,7 +130,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 3 }))] + [MemberData(nameof(MinData), (object)(new int[] { 3 }))] public static void Min_Float_Special(Labeled<ParallelQuery<int>> labeled, int count, float min) { // Null is defined as 'least' when ordered, but is not the minimum. @@ -145,7 +145,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Float_AllNull(Labeled<ParallelQuery<int>> labeled, int count, float min) { ParallelQuery<int> query = labeled.Item; @@ -154,7 +154,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Double(Labeled<ParallelQuery<int>> labeled, int count, double min) { ParallelQuery<int> query = labeled.Item; @@ -170,14 +170,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MinData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Min_Double_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, double min) { Min_Double(labeled, count, min); } [Theory] - [MemberData("MinData", (object)(new int[] { 3 }))] + [MemberData(nameof(MinData), (object)(new int[] { 3 }))] public static void Min_Double_Special(Labeled<ParallelQuery<int>> labeled, int count, double min) { // Null is defined as 'least' when ordered, but is not the minimum. @@ -192,7 +192,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Double_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, double min) { ParallelQuery<int> query = labeled.Item; @@ -201,7 +201,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Double_AllNull(Labeled<ParallelQuery<int>> labeled, int count, double min) { ParallelQuery<int> query = labeled.Item; @@ -210,7 +210,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Decimal(Labeled<ParallelQuery<int>> labeled, int count, decimal min) { ParallelQuery<int> query = labeled.Item; @@ -222,14 +222,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MinData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Min_Decimal_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, decimal min) { Min_Decimal(labeled, count, min); } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Decimal_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, decimal min) { ParallelQuery<int> query = labeled.Item; @@ -238,7 +238,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Decimal_AllNull(Labeled<ParallelQuery<int>> labeled, int count, decimal min) { ParallelQuery<int> query = labeled.Item; @@ -247,7 +247,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Other(Labeled<ParallelQuery<int>> labeled, int count, int min) { ParallelQuery<int> query = labeled.Item; @@ -257,14 +257,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("MinData", (object)(new int[] { 1024 * 32, 1024 * 1024 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1024 * 32, 1024 * 1024 }))] public static void Min_Other_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int min) { Min_Other(labeled, count, min); } [Theory] - [MemberData("MinData", (object)(new int[] { 1, }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, }))] public static void Min_NotComparable(Labeled<ParallelQuery<int>> labeled, int count, int min) { NotComparable a = new NotComparable(0); @@ -272,7 +272,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Other_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, int min) { ParallelQuery<int> query = labeled.Item; @@ -281,7 +281,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("MinData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(MinData), (object)(new int[] { 1, 2, 16 }))] public static void Min_Other_AllNull(Labeled<ParallelQuery<int>> labeled, int count, int min) { ParallelQuery<int> query = labeled.Item; @@ -290,7 +290,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0 }), MemberType = typeof(UnorderedSources))] public static void Min_EmptyNullable(Labeled<ParallelQuery<int>> labeled, int count) { Assert.Null(labeled.Item.Min(x => (int?)x)); @@ -302,7 +302,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0 }), MemberType = typeof(UnorderedSources))] public static void Min_InvalidOperationException(Labeled<ParallelQuery<int>> labeled, int count) { Assert.Throws<InvalidOperationException>(() => labeled.Item.Min()); @@ -314,7 +314,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Min_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -339,7 +339,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Min_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.Min((Func<int, int>)(x => { throw new DeliberateTestException(); }))); @@ -361,7 +361,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Min_AggregateException_NotComparable(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<ArgumentException>(() => labeled.Item.Min(x => new NotComparable(x))); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/OfTypeTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/OfTypeTests.cs index c19500650b..f1ddbf0d15 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/OfTypeTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/OfTypeTests.cs @@ -9,7 +9,7 @@ namespace System.Linq.Parallel.Tests public class OfTypeTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OfType_Unordered_AllValid(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -23,14 +23,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] public static void OfType_Unordered_AllValid_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_Unordered_AllValid(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void OfType_AllValid(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -44,14 +44,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] public static void OfType_AllValid_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_AllValid(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OfType_Unordered_AllValid_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -62,14 +62,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] public static void OfType_Unordered_AllValid_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_Unordered_AllValid_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void OfType_AllValid_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -80,15 +80,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] public static void OfType_AllValid_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_AllValid_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OfType_NoneValid(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -97,16 +97,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] public static void OfType_NoneValid_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_NoneValid(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OfType_NoneValid_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -115,15 +115,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] public static void OfType_NoneValid_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_NoneValid_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OfType_Unordered_SomeValid(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -137,14 +137,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] public static void OfType_Unordered_SomeValid_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_Unordered_SomeValid(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void OfType_SomeValid(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -158,14 +158,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] public static void OfType_SomeValid_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_SomeValid(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OfType_Unordered_SomeValid_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -176,14 +176,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(UnorderedSources))] public static void OfType_Unordered_SomeValid_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_Unordered_SomeValid_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void OfType_SomeValid_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -194,14 +194,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] public static void OfType_SomeValid_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_SomeValid_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void OfType_SomeInvalidNull(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -212,14 +212,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] public static void OfType_SomeInvalidNull_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_SomeInvalidNull(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void OfType_SomeValidNull(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -237,14 +237,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] public static void OfType_SomeValidNull_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_SomeValidNull(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void OfType_SomeNull(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -262,7 +262,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 256 }), MemberType = typeof(Sources))] public static void OfType_SomeNull_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OfType_SomeNull(labeled, count); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs index 70be739e22..5a40b740ca 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs @@ -62,9 +62,9 @@ namespace System.Linq.Parallel.Tests // OrderBy // [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderBy(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -80,18 +80,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderBy(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_Reversed(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -107,18 +107,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_Reversed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderBy_Reversed(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -134,18 +134,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderByDescending(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_Reversed(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -161,18 +161,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_Reversed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderByDescending_Reversed(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -183,18 +183,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderBy_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_Reversed_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -205,18 +205,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_Reversed_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderBy_Reversed_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -227,18 +227,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderByDescending_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_Reversed_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -249,18 +249,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_Reversed_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderByDescending_Reversed_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_CustomComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -276,18 +276,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderBy_CustomComparer(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_CustomComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -303,18 +303,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderByDescending_CustomComparer(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_NotPipelined_CustomComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -325,18 +325,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_NotPipelined_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderBy_NotPipelined_CustomComparer(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_NotPipelined_CustomComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -347,18 +347,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_NotPipelined_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { OrderByDescending_NotPipelined_CustomComparer(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] // Regression test for the PLINQ version of #2239 - comparer returning max/min value. public static void OrderBy_ExtremeComparer(Labeled<ParallelQuery<int>> labeled, int count) { @@ -371,9 +371,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] // Regression test for the PLINQ version of #2239 - comparer returning max/min value. public static void OrderByDescending_ExtremeComparer(Labeled<ParallelQuery<int>> labeled, int count) { @@ -386,9 +386,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_NotPipelined_ExtremeComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -396,9 +396,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_NotPipelined_ExtremeComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -406,9 +406,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 2 }))] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 2 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_NotComparable(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item.OrderBy(x => new NotComparable(x)); @@ -417,9 +417,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_NotComparable_Comparator(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -432,9 +432,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderBy_NotPipelined_NotComparable_Comparator(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -443,9 +443,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 2 }))] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 2 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_NotComparable(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item.OrderByDescending(x => new NotComparable(x)); @@ -454,9 +454,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_NotComparable_Comparator(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -469,9 +469,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void OrderByDescending_NotPipelined_NotComparable_Comparator(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -502,7 +502,7 @@ namespace System.Linq.Parallel.Tests // // In this test, every call to the key-selector delegate throws. [Theory] - [MemberData("OrderByThreadedData", new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })] + [MemberData(nameof(OrderByThreadedData), new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })] public static void OrderBy_ThreadedDeadlock(Labeled<ParallelQuery<int>> labeled, int count, int degree) { ParallelQuery<int> query = labeled.Item.WithDegreeOfParallelism(degree).OrderBy<int, int>(x => { throw new DeliberateTestException(); }); @@ -513,7 +513,7 @@ namespace System.Linq.Parallel.Tests // Heavily exercises OrderBy, but only throws one user delegate exception to simulate an occasional failure. [Theory] - [MemberData("OrderByThreadedData", new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })] + [MemberData(nameof(OrderByThreadedData), new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })] public static void OrderBy_ThreadedDeadlock_SingleException(Labeled<ParallelQuery<int>> labeled, int count, int degree) { int countdown = Math.Min(count / 2, degree) + 1; @@ -529,9 +529,9 @@ namespace System.Linq.Parallel.Tests // Thenby // [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = 0; @@ -554,18 +554,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenBy(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_Reversed(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = GroupFactor - 1; @@ -588,18 +588,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_Reversed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenBy_Reversed(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = GroupFactor - 1; @@ -622,18 +622,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenByDescending(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_Reversed(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = 0; @@ -656,18 +656,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_Reversed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenByDescending_Reversed(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = 0; @@ -691,18 +691,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenBy_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_Reversed_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = GroupFactor - 1; @@ -726,18 +726,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_Reversed_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenBy_Reversed_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = GroupFactor - 1; @@ -761,18 +761,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenByDescending_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_Reversed_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = 0; @@ -796,18 +796,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_Reversed_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenByDescending_Reversed_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_CustomComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = 0; @@ -830,18 +830,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenBy_CustomComparer(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_CustomComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = GroupFactor - 1; @@ -864,18 +864,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenByDescending_CustomComparer(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_NotPipelined_CustomComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = 0; @@ -899,18 +899,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_NotPipelined_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenBy_NotPipelined_CustomComparer(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_NotPipelined_CustomComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prevPrimary = GroupFactor - 1; @@ -934,18 +934,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_NotPipelined_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenByDescending_NotPipelined_CustomComparer(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] // Regression test for the PLINQ version of #2239 - comparer returning max/min value. public static void ThenBy_ExtremeComparer(Labeled<ParallelQuery<int>> labeled, int count) { @@ -958,9 +958,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] // Regression test for the PLINQ version of #2239 - comparer returning max/min value. public static void ThenByDescending_ExtremeComparer(Labeled<ParallelQuery<int>> labeled, int count) { @@ -973,8 +973,8 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_NotPipelined_ExtremeComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -982,9 +982,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_NotPipelined_ExtremeComparer(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -995,9 +995,9 @@ namespace System.Linq.Parallel.Tests // Due to the use of randomized input, cycles will not start with a known input (and may skip values, etc). [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_ThenBy(Labeled<ParallelQuery<int>> labeled, int count) { var prev = KeyValuePair.Create(0, KeyValuePair.Create(0, 0)); @@ -1014,18 +1014,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_ThenBy_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenBy_ThenBy(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_ThenByDescending(Labeled<ParallelQuery<int>> labeled, int count) { var prev = KeyValuePair.Create(GroupFactor - 1, KeyValuePair.Create(KeyFactor - 1, count - 1)); @@ -1042,18 +1042,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_ThenByDescending_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenByDescending_ThenByDescending(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_ThenBy_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { var prev = KeyValuePair.Create(0, KeyValuePair.Create(0, 0)); @@ -1071,18 +1071,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_ThenBy_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenBy_ThenBy_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_ThenByDescending_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { var prev = KeyValuePair.Create(GroupFactor - 1, KeyValuePair.Create(KeyFactor - 1, count - 1)); @@ -1100,18 +1100,18 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 1024, 1024 * 32 }))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 1024, 1024 * 32 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_ThenByDescending_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ThenByDescending_ThenByDescending_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 2 }))] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 2 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_NotComparable(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item.OrderBy(x => 0).ThenBy(x => new NotComparable(x)); @@ -1120,9 +1120,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_NotComparable_Comparator(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -1135,9 +1135,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenBy_NotPipelined_NotComparable_Comparator(Labeled<ParallelQuery<int>> labeled, int count) { int prev = 0; @@ -1146,9 +1146,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 2 }))] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 2 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_NotComparable(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item.OrderBy(x => 0).ThenByDescending(x => new NotComparable(x)); @@ -1157,9 +1157,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_NotComparable_Comparator(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -1172,9 +1172,9 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("OrderByRandomData", (object)(new[] { 0, 1, 2, 16 }))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(OrderByRandomData), (object)(new[] { 0, 1, 2, 16 }))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ThenByDescending_NotPipelined_NotComparable_Comparator(Labeled<ParallelQuery<int>> labeled, int count) { int prev = count - 1; @@ -1205,8 +1205,8 @@ namespace System.Linq.Parallel.Tests // Ensures that indices issued during a query are stable, **not** that OrderBy returns a stable result on its own (it does not). // [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void StableSort(Labeled<ParallelQuery<int>> labeled, int count) { var prev = KeyValuePair.Create(0, KeyValuePair.Create(0, 0)); @@ -1227,16 +1227,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void StableSort_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { StableSort(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void StableSort_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { var prev = KeyValuePair.Create(0, KeyValuePair.Create(0, 0)); @@ -1258,16 +1258,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void StableSort_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { StableSort_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void StableSort_Descending(Labeled<ParallelQuery<int>> labeled, int count) { var prev = KeyValuePair.Create(count, KeyValuePair.Create(count, count / GroupFactor)); @@ -1289,16 +1289,16 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void StableSort_Descending_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { StableSort_Descending(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void StableSort_Descending_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { var prev = KeyValuePair.Create(count, KeyValuePair.Create(count, count / GroupFactor)); @@ -1320,8 +1320,8 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 32 }), MemberType = typeof(UnorderedSources))] public static void StableSort_Descending_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { StableSort_Descending_NotPipelined(labeled, count); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ReverseTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ReverseTests.cs index adb0cd6928..3646ab1185 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ReverseTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ReverseTests.cs @@ -9,7 +9,7 @@ namespace System.Linq.Parallel.Tests public class ReverseTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Reverse_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -23,14 +23,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] public static void Reverse_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Reverse_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void Reverse(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -44,14 +44,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] public static void Reverse_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Reverse(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Reverse_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -62,14 +62,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] public static void Reverse_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Reverse_Unordered_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void Reverse_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -80,7 +80,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] public static void Reverse_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Reverse_NotPipelined(labeled, count); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/SelectSelectManyTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/SelectSelectManyTests.cs index cb49d3fefe..c8077cee9f 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/SelectSelectManyTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/SelectSelectManyTests.cs @@ -10,7 +10,7 @@ namespace System.Linq.Parallel.Tests public class SelectSelectManyTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Select_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -25,14 +25,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Select_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Select_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void Select(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -47,14 +47,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(Sources))] public static void Select_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Select(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Select_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -66,14 +66,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Select_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Select_Unordered_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void Select_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -89,7 +89,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(Sources))] public static void Select_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Select_NotPipelined(labeled, count); @@ -100,7 +100,7 @@ namespace System.Linq.Parallel.Tests // larger input sizes increases the probability that it will. [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Select_Indexed_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { // For unordered collections, which element is at which index isn't actually guaranteed, but an effect of the implementation. @@ -117,14 +117,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Select_Indexed_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Select_Indexed_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void Select_Indexed(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -139,14 +139,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(Sources))] public static void Select_Indexed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Select_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Select_Indexed_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { // For unordered collections, which element is at which index isn't actually guaranteed, but an effect of the implementation. @@ -164,14 +164,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(UnorderedSources))] public static void Select_Indexed_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Select_Indexed_Unordered_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void Select_Indexed_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -187,7 +187,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024, 1024 * 4 }), MemberType = typeof(Sources))] public static void Select_Indexed_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Select_Indexed_NotPipelined(labeled, count); @@ -242,7 +242,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Unordered(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -257,14 +257,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Unordered(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -279,14 +279,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -298,14 +298,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Unordered_NotPipelined(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -317,14 +317,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_NotPipelined(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Unordered_ResultSelector(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -340,14 +340,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Unordered_ResultSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Unordered_ResultSelector(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Unordered_ResultSelector_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -364,14 +364,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Unordered_ResultSelector_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Unordered_ResultSelector_NotPipelined(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_ResultSelector(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -387,14 +387,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_ResultSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_ResultSelector(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_ResultSelector_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -411,14 +411,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_ResultSelector_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_ResultSelector_NotPipelined(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Indexed_Unordered(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { // For unordered collections, which element is at which index isn't actually guaranteed, but an effect of the implementation. @@ -436,14 +436,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Indexed_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Indexed_Unordered(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Indexed_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { // For unordered collections, which element is at which index isn't actually guaranteed, but an effect of the implementation. @@ -462,14 +462,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Indexed_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Indexed_Unordered_NotPipelined(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Indexed(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -485,14 +485,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Indexed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Indexed(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Indexed_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -509,14 +509,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Indexed_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Indexed_NotPipelined(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Indexed_Unordered_ResultSelector(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { // For unordered collections, which element is at which index isn't actually guaranteed, but an effect of the implementation. @@ -536,14 +536,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Indexed_Unordered_ResultSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Indexed_Unordered_ResultSelector(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Indexed_Unordered_ResultSelector_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { // For unordered collections, which element is at which index isn't actually guaranteed, but an effect of the implementation. @@ -564,14 +564,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyUnorderedData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyUnorderedData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Indexed_Unordered_ResultSelector_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Indexed_Unordered_ResultSelector_NotPipelined(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Indexed_ResultSelector(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -589,14 +589,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Indexed_ResultSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Indexed_ResultSelector(labeled, count, expander, expansion); } [Theory] - [MemberData("SelectManyData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SelectMany_Indexed_ResultSelector_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { ParallelQuery<int> query = labeled.Item; @@ -615,7 +615,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SelectManyData", (object)(new int[] { 1024, 1024 * 4 }))] + [MemberData(nameof(SelectManyData), (object)(new int[] { 1024, 1024 * 4 }))] public static void SelectMany_Indexed_ResultSelector_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, Labeled<Func<int, int, IEnumerable<int>>> expander, int expansion) { SelectMany_Indexed_ResultSelector_NotPipelined(labeled, count, expander, expansion); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/SequenceEqualTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/SequenceEqualTests.cs index 7be0366755..f3bc9fbb6e 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/SequenceEqualTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/SequenceEqualTests.cs @@ -51,7 +51,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SequenceEqualData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SequenceEqualData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SequenceEqual(Labeled<ParallelQuery<int>> left, Labeled<ParallelQuery<int>> right, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -63,14 +63,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SequenceEqualData", (object)(new int[] { 1024 * 4, 1024 * 128 }))] + [MemberData(nameof(SequenceEqualData), (object)(new int[] { 1024 * 4, 1024 * 128 }))] public static void SequenceEqual_Longrunning(Labeled<ParallelQuery<int>> left, Labeled<ParallelQuery<int>> right, int count) { SequenceEqual(left, right, count); } [Theory] - [MemberData("SequenceEqualData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SequenceEqualData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SequenceEqual_CustomComparator(Labeled<ParallelQuery<int>> left, Labeled<ParallelQuery<int>> right, int count) { ParallelQuery<int> leftQuery = left.Item; @@ -88,14 +88,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SequenceEqualData", (object)(new int[] { 1024 * 4, 1024 * 128 }))] + [MemberData(nameof(SequenceEqualData), (object)(new int[] { 1024 * 4, 1024 * 128 }))] public static void SequenceEqual_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> left, Labeled<ParallelQuery<int>> right, int count) { SequenceEqual_CustomComparator(left, right, count); } [Theory] - [MemberData("SequenceEqualUnequalSizeData", (object)(new int[] { 0, 4, 16 }))] + [MemberData(nameof(SequenceEqualUnequalSizeData), (object)(new int[] { 0, 4, 16 }))] public static void SequenceEqual_UnequalSize(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -108,14 +108,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SequenceEqualUnequalSizeData", (object)(new int[] { 1024 * 4, 1024 * 128 }))] + [MemberData(nameof(SequenceEqualUnequalSizeData), (object)(new int[] { 1024 * 4, 1024 * 128 }))] public static void SequenceEqual_UnequalSize_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { SequenceEqual_UnequalSize(left, leftCount, right, rightCount); } [Theory] - [MemberData("SequenceEqualUnequalData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SequenceEqualUnequalData), (object)(new int[] { 1, 2, 16 }))] public static void SequenceEqual_Unequal(Labeled<ParallelQuery<int>> left, Labeled<ParallelQuery<int>> right, int count, int item) { ParallelQuery<int> leftQuery = left.Item; @@ -128,7 +128,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SequenceEqualUnequalData", (object)(new int[] { 1024 * 4, 1024 * 128 }))] + [MemberData(nameof(SequenceEqualUnequalData), (object)(new int[] { 1024 * 4, 1024 * 128 }))] public static void SequenceEqual_Unequal_Longrunning(Labeled<ParallelQuery<int>> left, Labeled<ParallelQuery<int>> right, int count, int item) { SequenceEqual_Unequal(left, right, count, item); @@ -143,7 +143,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SequenceEqualUnequalData", (object)(new int[] { 4 }))] + [MemberData(nameof(SequenceEqualUnequalData), (object)(new int[] { 4 }))] public static void SequenceEqual_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> left, Labeled<ParallelQuery<int>> right, int count, int item) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -157,7 +157,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SequenceEqualUnequalData", (object)(new int[] { 4 }))] + [MemberData(nameof(SequenceEqualUnequalData), (object)(new int[] { 4 }))] public static void SequenceEqual_AggregateException(Labeled<ParallelQuery<int>> left, Labeled<ParallelQuery<int>> right, int count, int item) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => left.Item.SequenceEqual(right.Item, new FailingEqualityComparer<int>())); @@ -184,7 +184,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SequenceEqualData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SequenceEqualData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SequenceEqual_DisposeException(Labeled<ParallelQuery<int>> left, Labeled<ParallelQuery<int>> right, int count) { ParallelQuery<int> leftQuery = left.Item; diff --git a/src/System.Linq.Parallel/tests/QueryOperators/SingleSingleOrDefaultTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/SingleSingleOrDefaultTests.cs index 3ef2e6aaca..86f2c799d0 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/SingleSingleOrDefaultTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/SingleSingleOrDefaultTests.cs @@ -36,7 +36,7 @@ namespace System.Linq.Parallel.Tests // Single and SingleOrDefault // [Theory] - [MemberData("SingleData", new int[] { 0, 2, 16, 1024 * 1024 }, new int[] { 1 })] + [MemberData(nameof(SingleData), new int[] { 0, 2, 16, 1024 * 1024 }, new int[] { 1 })] public static void Single(Labeled<ParallelQuery<int>> labeled, int count, int element) { ParallelQuery<int> query = labeled.Item; @@ -45,7 +45,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SingleData", new int[] { 0, 2, 16, 1024 * 1024 }, new int[] { 0, 1 })] + [MemberData(nameof(SingleData), new int[] { 0, 2, 16, 1024 * 1024 }, new int[] { 0, 1 })] public static void SingleOrDefault(Labeled<ParallelQuery<int>> labeled, int count, int element) { ParallelQuery<int> query = labeled.Item; @@ -54,7 +54,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SingleData", new int[] { 0, 1024 * 1024 }, new int[] { 0 })] + [MemberData(nameof(SingleData), new int[] { 0, 1024 * 1024 }, new int[] { 0 })] public static void Single_Empty(Labeled<ParallelQuery<int>> labeled, int count, int element) { ParallelQuery<int> query = labeled.Item; @@ -63,7 +63,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SingleData", new int[] { 0 }, new int[] { 0, 1, 2, 16 })] + [MemberData(nameof(SingleData), new int[] { 0 }, new int[] { 0, 1, 2, 16 })] public static void Single_NoMatch(Labeled<ParallelQuery<int>> labeled, int count, int element) { ParallelQuery<int> query = labeled.Item; @@ -74,14 +74,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SingleData", new int[] { 0 }, new int[] { 1024 * 4, 1024 * 1024 })] + [MemberData(nameof(SingleData), new int[] { 0 }, new int[] { 1024 * 4, 1024 * 1024 })] public static void Single_NoMatch_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int element) { Single_NoMatch(labeled, count, element); } [Theory] - [MemberData("SingleData", new int[] { 0 }, new int[] { 0, 1, 2, 16 })] + [MemberData(nameof(SingleData), new int[] { 0 }, new int[] { 0, 1, 2, 16 })] public static void SingleOrDefault_NoMatch(Labeled<ParallelQuery<int>> labeled, int count, int element) { ParallelQuery<int> query = labeled.Item; @@ -92,14 +92,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SingleData", new int[] { 0 }, new int[] { 1024 * 4, 1024 * 1024 })] + [MemberData(nameof(SingleData), new int[] { 0 }, new int[] { 1024 * 4, 1024 * 1024 })] public static void SingleOrDefault_NoMatch_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int element) { SingleOrDefault_NoMatch(labeled, count, element); } [Theory] - [MemberData("SingleData", new int[] { 0 }, new int[] { 2, 16 })] + [MemberData(nameof(SingleData), new int[] { 0 }, new int[] { 2, 16 })] public static void Single_AllMatch(Labeled<ParallelQuery<int>> labeled, int count, int element) { ParallelQuery<int> query = labeled.Item; @@ -108,14 +108,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SingleData", new int[] { 0 }, new int[] { 1024 * 4, 1024 * 1024 })] + [MemberData(nameof(SingleData), new int[] { 0 }, new int[] { 1024 * 4, 1024 * 1024 })] public static void Single_AllMatch_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int element) { Single_AllMatch(labeled, count, element); } [Theory] - [MemberData("SingleData", new int[] { 0 }, new int[] { 2, 16 })] + [MemberData(nameof(SingleData), new int[] { 0 }, new int[] { 2, 16 })] public static void SingleOrDefault_AllMatch(Labeled<ParallelQuery<int>> labeled, int count, int element) { ParallelQuery<int> query = labeled.Item; @@ -124,14 +124,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SingleData", new int[] { 0 }, new int[] { 1024 * 4, 1024 * 1024 })] + [MemberData(nameof(SingleData), new int[] { 0 }, new int[] { 1024 * 4, 1024 * 1024 })] public static void SingleOrDefault_AllMatch_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int element) { SingleOrDefault_AllMatch(labeled, count, element); } [Theory] - [MemberData("SingleSpecificData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SingleSpecificData), (object)(new int[] { 1, 2, 16 }))] public static void Single_OneMatch(Labeled<ParallelQuery<int>> labeled, int count, int element) { ParallelQuery<int> query = labeled.Item; @@ -142,14 +142,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SingleSpecificData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(SingleSpecificData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void Single_OneMatch_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int element) { Single_OneMatch(labeled, count, element); } [Theory] - [MemberData("SingleSpecificData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SingleSpecificData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SingleOrDefault_OneMatch(Labeled<ParallelQuery<int>> labeled, int count, int element) { ParallelQuery<int> query = labeled.Item; @@ -160,14 +160,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SingleSpecificData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(SingleSpecificData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void SingleOrDefault_OneMatch_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int element) { SingleOrDefault_OneMatch(labeled, count, element); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Single_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -181,7 +181,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void Single_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.Single(x => { throw new DeliberateTestException(); })); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/SkipSkipWhileTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/SkipSkipWhileTests.cs index d3548086e4..903de588e3 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/SkipSkipWhileTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/SkipSkipWhileTests.cs @@ -26,7 +26,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SkipUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Skip_Unordered(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -42,14 +42,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void Skip_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { Skip_Unordered(labeled, count, skip); } [Theory] - [MemberData("SkipData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Skip(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -63,14 +63,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 1024 * 32 }))] public static void Skip_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { Skip(labeled, count, skip); } [Theory] - [MemberData("SkipUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Skip_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -83,14 +83,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void Skip_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { Skip_Unordered_NotPipelined(labeled, count, skip); } [Theory] - [MemberData("SkipData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Skip_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -101,7 +101,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 1024 * 32 }))] public static void Skip_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { Skip_NotPipelined(labeled, count, skip); @@ -127,7 +127,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SkipUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SkipWhile_Unordered(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -143,14 +143,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { SkipWhile_Unordered(labeled, count, skip); } [Theory] - [MemberData("SkipData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SkipWhile(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -164,14 +164,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { SkipWhile(labeled, count, skip); } [Theory] - [MemberData("SkipUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SkipWhile_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -184,14 +184,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { SkipWhile_Unordered_NotPipelined(labeled, count, skip); } [Theory] - [MemberData("SkipData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SkipWhile_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -202,14 +202,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { SkipWhile_NotPipelined(labeled, count, skip); } [Theory] - [MemberData("SkipUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SkipWhile_Indexed_Unordered(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -225,14 +225,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_Indexed_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { SkipWhile_Indexed_Unordered(labeled, count, skip); } [Theory] - [MemberData("SkipData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SkipWhile_Indexed(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -246,14 +246,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_Indexed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { SkipWhile_Indexed(labeled, count, skip); } [Theory] - [MemberData("SkipUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SkipWhile_Indexed_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -266,14 +266,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_Indexed_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { SkipWhile_Indexed_Unordered_NotPipelined(labeled, count, skip); } [Theory] - [MemberData("SkipData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SkipWhile_Indexed_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -284,14 +284,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_Indexed_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { SkipWhile_Indexed_NotPipelined(labeled, count, skip); } [Theory] - [MemberData("SkipData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SkipWhile_AllFalse(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -302,14 +302,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_AllFalse_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { SkipWhile_AllFalse(labeled, count, skip); } [Theory] - [MemberData("SkipData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 0, 1, 2, 16 }))] public static void SkipWhile_AllTrue(Labeled<ParallelQuery<int>> labeled, int count, int skip) { ParallelQuery<int> query = labeled.Item; @@ -320,14 +320,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_AllTrue_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int skip) { SkipWhile_AllTrue(labeled, count, skip); } [Theory] - [MemberData("SkipWhileData", (object)(new int[] { 2, 16 }))] + [MemberData(nameof(SkipWhileData), (object)(new int[] { 2, 16 }))] public static void SkipWhile_SomeTrue(Labeled<ParallelQuery<int>> labeled, int count, IEnumerable<int> skip) { ParallelQuery<int> query = labeled.Item; @@ -338,14 +338,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipWhileData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipWhileData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_SomeTrue_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, IEnumerable<int> skip) { SkipWhile_SomeTrue(labeled, count, skip); } [Theory] - [MemberData("SkipWhileData", (object)(new int[] { 2, 16 }))] + [MemberData(nameof(SkipWhileData), (object)(new int[] { 2, 16 }))] public static void SkipWhile_SomeFalse(Labeled<ParallelQuery<int>> labeled, int count, IEnumerable<int> skip) { ParallelQuery<int> query = labeled.Item; @@ -356,7 +356,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SkipWhileData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(SkipWhileData), (object)(new int[] { 1024 * 32 }))] public static void SkipWhile_SomeFalse_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, IEnumerable<int> skip) { SkipWhile_SomeFalse(labeled, count, skip); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/SumTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/SumTests.cs index b556ffb9df..1b6fca262a 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/SumTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/SumTests.cs @@ -19,7 +19,7 @@ namespace System.Linq.Parallel.Tests // Sum // [Theory] - [MemberData("SumData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Sum_Int(Labeled<ParallelQuery<int>> labeled, int count, int sum) { ParallelQuery<int> query = labeled.Item; @@ -32,7 +32,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1, 2, 16 }))] public static void Sum_Int_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, int sum) { ParallelQuery<int> query = labeled.Item; @@ -41,7 +41,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1, 2, 16 }))] public static void Sum_Int_AllNull(Labeled<ParallelQuery<int>> labeled, int count, int sum) { ParallelQuery<int> query = labeled.Item; @@ -51,14 +51,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SumData", (object)(new int[] { 1024 * 4, 1024 * 64 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1024 * 4, 1024 * 64 }))] public static void Sum_Int_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int sum) { Sum_Int(labeled, count, sum); } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Sum_Int_Overflow(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<OverflowException>(() => labeled.Item.Select(x => x == 0 ? int.MaxValue : x).Sum()); @@ -68,7 +68,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Sum_Long(Labeled<ParallelQuery<int>> labeled, int count, long sum) { ParallelQuery<int> query = labeled.Item; @@ -82,14 +82,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SumData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void Sum_Long_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, long sum) { Sum_Long(labeled, count, sum); } [Theory] - [MemberData("SumData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1, 2, 16 }))] public static void Sum_Long_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, long sum) { ParallelQuery<int> query = labeled.Item; @@ -98,7 +98,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1, 2, 16 }))] public static void Sum_Long_AllNull(Labeled<ParallelQuery<int>> labeled, int count, long sum) { ParallelQuery<int> query = labeled.Item; @@ -107,7 +107,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Sum_Long_Overflow(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<OverflowException>(() => labeled.Item.Select(x => x == 0 ? long.MaxValue : x).Sum()); @@ -117,7 +117,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Sum_Float(Labeled<ParallelQuery<int>> labeled, int count, float sum) { ParallelQuery<int> query = labeled.Item; @@ -131,14 +131,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SumData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void Sum_Float_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, float sum) { Sum_Float(labeled, count, sum); } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Sum_Float_Overflow(Labeled<ParallelQuery<int>> labeled, int count) { Assert.Equal(float.PositiveInfinity, labeled.Item.Select(x => float.MaxValue).Sum()); @@ -161,7 +161,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Sum_Float_NaN(Labeled<ParallelQuery<int>> labeled, int count) { Assert.Equal(float.NaN, labeled.Item.Select(x => x == 0 ? float.NaN : x).Sum()); @@ -184,7 +184,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1, 2, 16 }))] public static void Sum_Float_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, float sum) { ParallelQuery<int> query = labeled.Item; @@ -193,7 +193,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1, 2, 16 }))] public static void Sum_Float_AllNull(Labeled<ParallelQuery<int>> labeled, int count, float sum) { ParallelQuery<int> query = labeled.Item; @@ -202,7 +202,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Sum_Double(Labeled<ParallelQuery<int>> labeled, int count, double sum) { ParallelQuery<int> query = labeled.Item; @@ -216,14 +216,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SumData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void Sum_Double_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, double sum) { Sum_Double(labeled, count, sum); } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Sum_Double_Overflow(Labeled<ParallelQuery<int>> labeled, int count) { Assert.Equal(double.PositiveInfinity, labeled.Item.Select(x => double.MaxValue).Sum()); @@ -246,7 +246,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Sum_Double_NaN(Labeled<ParallelQuery<int>> labeled, int count) { Assert.Equal(double.NaN, labeled.Item.Select(x => x == 0 ? double.NaN : x).Sum()); @@ -269,7 +269,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1, 2, 16 }))] public static void Sum_Double_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, double sum) { ParallelQuery<int> query = labeled.Item; @@ -278,7 +278,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1, 2, 16 }))] public static void Sum_Double_AllNull(Labeled<ParallelQuery<int>> labeled, int count, double sum) { ParallelQuery<int> query = labeled.Item; @@ -287,7 +287,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Sum_Decimal(Labeled<ParallelQuery<int>> labeled, int count, decimal sum) { ParallelQuery<int> query = labeled.Item; @@ -300,14 +300,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("SumData", (object)(new int[] { 1024 * 4, 1024 * 1024 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1024 * 4, 1024 * 1024 }))] public static void Sum_Decimal_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, decimal sum) { Sum_Decimal(labeled, count, sum); } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Sum_Decimal_Overflow(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<OverflowException>(() => labeled.Item.Select(x => x == 0 ? decimal.MaxValue : x).Sum()); @@ -317,7 +317,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1, 2, 16 }))] public static void Sum_Decimal_SomeNull(Labeled<ParallelQuery<int>> labeled, int count, decimal sum) { ParallelQuery<int> query = labeled.Item; @@ -326,7 +326,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("SumData", (object)(new int[] { 1, 2, 16 }))] + [MemberData(nameof(SumData), (object)(new int[] { 1, 2, 16 }))] public static void Sum_Decimal_AllNull(Labeled<ParallelQuery<int>> labeled, int count, decimal sum) { ParallelQuery<int> query = labeled.Item; @@ -335,7 +335,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Sum_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -358,7 +358,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 2 }), MemberType = typeof(UnorderedSources))] public static void Sum_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.Sum((Func<int, int>)(x => { throw new DeliberateTestException(); }))); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/TakeTakeWhileTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/TakeTakeWhileTests.cs index 6ec81dae6a..07ea5e3291 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/TakeTakeWhileTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/TakeTakeWhileTests.cs @@ -25,7 +25,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("TakeUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Take_Unordered(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -41,14 +41,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void Take_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { Take_Unordered(labeled, count, take); } [Theory] - [MemberData("TakeData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Take(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -62,14 +62,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 1024 * 32 }))] public static void Take_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { Take(labeled, count, take); } [Theory] - [MemberData("TakeUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Take_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -82,14 +82,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void Take_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { Take_Unordered_NotPipelined(labeled, count, take); } [Theory] - [MemberData("TakeData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Take_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -100,7 +100,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 1024 * 32 }))] public static void Take_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { Take_NotPipelined(labeled, count, take); @@ -126,7 +126,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("TakeUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void TakeWhile_Unordered(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -142,14 +142,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { TakeWhile_Unordered(labeled, count, take); } [Theory] - [MemberData("TakeData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 0, 1, 2, 16 }))] public static void TakeWhile(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -163,14 +163,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { TakeWhile(labeled, count, take); } [Theory] - [MemberData("TakeUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void TakeWhile_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -183,14 +183,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { TakeWhile_Unordered_NotPipelined(labeled, count, take); } [Theory] - [MemberData("TakeData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 0, 1, 2, 16 }))] public static void TakeWhile_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -201,14 +201,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { TakeWhile_NotPipelined(labeled, count, take); } [Theory] - [MemberData("TakeUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void TakeWhile_Indexed_Unordered(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -224,14 +224,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_Indexed_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { TakeWhile_Indexed_Unordered(labeled, count, take); } [Theory] - [MemberData("TakeData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 0, 1, 2, 16 }))] public static void TakeWhile_Indexed(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -245,14 +245,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_Indexed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { TakeWhile_Indexed(labeled, count, take); } [Theory] - [MemberData("TakeUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void TakeWhile_Indexed_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -265,14 +265,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_Indexed_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { TakeWhile_Indexed_Unordered_NotPipelined(labeled, count, take); } [Theory] - [MemberData("TakeData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 0, 1, 2, 16 }))] public static void TakeWhile_Indexed_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -283,14 +283,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_Indexed_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { TakeWhile_Indexed_NotPipelined(labeled, count, take); } [Theory] - [MemberData("TakeUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void TakeWhile_AllFalse(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -299,14 +299,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeUnorderedData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeUnorderedData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_AllFalse_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { TakeWhile_AllFalse(labeled, count, take); } [Theory] - [MemberData("TakeData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 0, 1, 2, 16 }))] public static void TakeWhile_AllTrue(Labeled<ParallelQuery<int>> labeled, int count, int take) { ParallelQuery<int> query = labeled.Item; @@ -317,14 +317,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_AllTrue_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, int take) { TakeWhile_AllTrue(labeled, count, take); } [Theory] - [MemberData("TakeWhileData", (object)(new int[] { 2, 16 }))] + [MemberData(nameof(TakeWhileData), (object)(new int[] { 2, 16 }))] public static void TakeWhile_SomeTrue(Labeled<ParallelQuery<int>> labeled, int count, IEnumerable<int> take) { ParallelQuery<int> query = labeled.Item; @@ -335,14 +335,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeWhileData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeWhileData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_SomeTrue_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, IEnumerable<int> take) { TakeWhile_SomeTrue(labeled, count, take); } [Theory] - [MemberData("TakeWhileData", (object)(new int[] { 2, 16 }))] + [MemberData(nameof(TakeWhileData), (object)(new int[] { 2, 16 }))] public static void TakeWhile_SomeFalse(Labeled<ParallelQuery<int>> labeled, int count, IEnumerable<int> take) { ParallelQuery<int> query = labeled.Item; @@ -353,7 +353,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("TakeWhileData", (object)(new int[] { 1024 * 32 }))] + [MemberData(nameof(TakeWhileData), (object)(new int[] { 1024 * 32 }))] public static void TakeWhile_SomeFalse_Longrunning(Labeled<ParallelQuery<int>> labeled, int count, IEnumerable<int> take) { TakeWhile_SomeFalse(labeled, count, take); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ToArrayTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ToArrayTests.cs index b2db3943c8..8b80b3fa5f 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ToArrayTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ToArrayTests.cs @@ -10,7 +10,7 @@ namespace System.Linq.Parallel.Tests public class ToArrayTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToArray_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -21,14 +21,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] public static void ToArray_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToArray_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void ToArray(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -39,15 +39,15 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] public static void ToArray_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToArray(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(Sources))] - [MemberData("ThrowOnFirstEnumeration", MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(Sources))] + [MemberData(nameof(UnorderedSources.ThrowOnFirstEnumeration), MemberType = typeof(UnorderedSources))] public static void ToArray_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ToDictionaryTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ToDictionaryTests.cs index bba937e5bb..07a9a08b63 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ToDictionaryTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ToDictionaryTests.cs @@ -11,7 +11,7 @@ namespace System.Linq.Parallel.Tests public class ToDictionaryTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -23,14 +23,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToDictionary(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_ElementSelector(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -42,14 +42,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_ElementSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToDictionary_ElementSelector(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -61,14 +61,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToDictionary_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_ElementSelector_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -80,14 +80,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_ElementSelector_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToDictionary_ElementSelector_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_UniqueKeys_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -114,14 +114,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_UniqueKeys_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToDictionary_UniqueKeys_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_ElementSelector_UniqueKeys_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -148,7 +148,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_ElementSelector_UniqueKeys_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToDictionary_ElementSelector_UniqueKeys_CustomComparator(labeled, count); @@ -162,7 +162,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_DuplicateKeys_ElementSelector(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -172,7 +172,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_DuplicateKeys_ElementSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToDictionary_DuplicateKeys_ElementSelector(labeled, count); @@ -186,7 +186,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_DuplicateKeys_ElementSelector_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -196,14 +196,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 16 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_DuplicateKeys_ElementSelector_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToDictionary_DuplicateKeys_ElementSelector_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -216,7 +216,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void ToDictionary_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.ToDictionary((Func<int, int>)(x => { throw new DeliberateTestException(); }))); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ToListTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ToListTests.cs index e03f050c5a..7a06ca707d 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ToListTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ToListTests.cs @@ -10,7 +10,7 @@ namespace System.Linq.Parallel.Tests public class ToListTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToList_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -21,14 +21,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(UnorderedSources))] public static void ToList_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToList_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(Sources))] public static void ToList(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -39,14 +39,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 1024 }), MemberType = typeof(Sources))] public static void ToList_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToList(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(Sources))] public static void ToList_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ToLookupTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ToLookupTests.cs index 4c50f69ea9..3a77053cc9 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ToLookupTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ToLookupTests.cs @@ -11,7 +11,7 @@ namespace System.Linq.Parallel.Tests public class ToLookupTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToLookup(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -25,14 +25,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToLookup(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_ElementSelector(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -46,14 +46,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_ElementSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToLookup_ElementSelector(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -67,14 +67,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToLookup_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_ElementSelector_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -91,14 +91,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_ElementSelector_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToLookup_ElementSelector_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_DuplicateKeys(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -118,14 +118,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_DuplicateKeys_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToLookup_DuplicateKeys(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_DuplicateKeys_ElementSelector(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -145,14 +145,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_DuplicateKeys_ElementSelector_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToLookup_DuplicateKeys_ElementSelector(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_DuplicateKeys_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -175,14 +175,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_DuplicateKeys_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToLookup_DuplicateKeys_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 0, 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_DuplicateKeys_ElementSelector_CustomComparator(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -205,14 +205,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 128 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_DuplicateKeys_ElementSelector_CustomComparator_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { ToLookup_DuplicateKeys_ElementSelector_CustomComparator(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_OperationCanceledException_PreCanceled(Labeled<ParallelQuery<int>> labeled, int count) { CancellationTokenSource cs = new CancellationTokenSource(); @@ -226,7 +226,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("Ranges", (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1 }), MemberType = typeof(UnorderedSources))] public static void ToLookup_AggregateException(Labeled<ParallelQuery<int>> labeled, int count) { Functions.AssertThrowsWrapped<DeliberateTestException>(() => labeled.Item.ToLookup((Func<int, int>)(x => { throw new DeliberateTestException(); }))); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/UnionTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/UnionTests.cs index c581234699..3dbae3d360 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/UnionTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/UnionTests.cs @@ -69,7 +69,7 @@ namespace System.Linq.Parallel.Tests // Union // [Theory] - [MemberData("UnionUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_Unordered(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -84,14 +84,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionUnorderedData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionUnorderedData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_Unordered_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_Unordered(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -106,14 +106,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionFirstOrderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionFirstOrderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_FirstOrdered(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -137,14 +137,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionFirstOrderedData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionFirstOrderedData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_FirstOrdered_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_FirstOrdered(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionSecondOrderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionSecondOrderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_SecondOrdered(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -168,14 +168,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionSecondOrderedData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionSecondOrderedData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_SecondOrdered_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_SecondOrdered(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_Unordered_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -187,14 +187,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionUnorderedData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionUnorderedData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_Unordered_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -206,14 +206,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionFirstOrderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionFirstOrderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_FirstOrdered_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -231,14 +231,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionFirstOrderedData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionFirstOrderedData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_FirstOrdered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_FirstOrdered_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionSecondOrderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionSecondOrderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_SecondOrdered_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -256,14 +256,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionSecondOrderedData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionSecondOrderedData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_SecondOrdered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_SecondOrdered_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_Unordered_Distinct(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -282,14 +282,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionUnorderedData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionUnorderedData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_Unordered_Distinct_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_Unordered_Distinct(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_Distinct(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -308,14 +308,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_Distinct_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_Distinct(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionFirstOrderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionFirstOrderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_FirstOrdered_Distinct(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -344,14 +344,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionFirstOrderedData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionFirstOrderedData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_FirstOrdered_Distinct_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_FirstOrdered_Distinct(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionSecondOrderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionSecondOrderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_SecondOrdered_Distinct(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -380,14 +380,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionSecondOrderedData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionSecondOrderedData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_SecondOrdered_Distinct_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_SecondOrdered_Distinct(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionUnorderedData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionUnorderedData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_Unordered_Distinct_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -404,14 +404,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionUnorderedData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionUnorderedData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_Unordered_Distinct_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_Unordered_Distinct_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionData", new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] + [MemberData(nameof(UnionData), new int[] { 0, 1, 2, 16 }, new int[] { 0, 1, 8 })] public static void Union_Distinct_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -429,14 +429,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionData", new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] + [MemberData(nameof(UnionData), new int[] { 512, 1024 * 8 }, new int[] { 0, 1, 1024, 1024 * 16 })] public static void Union_Distinct_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Union_Distinct_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("UnionSourceMultipleData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(UnionSourceMultipleData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Union_Unordered_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { // The difference between this test and the previous, is that it's not possible to @@ -450,14 +450,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionSourceMultipleData", (object)(new int[] { 512, 1024 * 8 }))] + [MemberData(nameof(UnionSourceMultipleData), (object)(new int[] { 512, 1024 * 8 }))] public static void Union_Unordered_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { Union_Unordered_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, count); } [Theory] - [MemberData("UnionSourceMultipleData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(UnionSourceMultipleData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Union_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { int seen = 0; @@ -467,14 +467,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionSourceMultipleData", (object)(new int[] { 512, 1024 * 8 }))] + [MemberData(nameof(UnionSourceMultipleData), (object)(new int[] { 512, 1024 * 8 }))] public static void Union_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { Union_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, count); } [Theory] - [MemberData("UnionSourceMultipleData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(UnionSourceMultipleData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Union_FirstOrdered_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { IntegerRangeSet seenUnordered = new IntegerRangeSet(leftCount, count - leftCount); @@ -496,14 +496,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionSourceMultipleData", (object)(new int[] { 512, 1024 * 8 }))] + [MemberData(nameof(UnionSourceMultipleData), (object)(new int[] { 512, 1024 * 8 }))] public static void Union_FirstOrdered_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { Union_FirstOrdered_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, count); } [Theory] - [MemberData("UnionSourceMultipleData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(UnionSourceMultipleData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Union_SecondOrdered_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { IntegerRangeSet seenUnordered = new IntegerRangeSet(0, leftCount); @@ -525,7 +525,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("UnionSourceMultipleData", (object)(new int[] { 512, 1024 * 8 }))] + [MemberData(nameof(UnionSourceMultipleData), (object)(new int[] { 512, 1024 * 8 }))] public static void Union_SecondOrdered_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { Union_SecondOrdered_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, count); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/WhereTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/WhereTests.cs index 49db2ce26b..670bbb8840 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/WhereTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/WhereTests.cs @@ -9,7 +9,7 @@ namespace System.Linq.Parallel.Tests public class WhereTests { [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Where_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -24,14 +24,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] public static void Where_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Where_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] public static void Where(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -45,14 +45,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] public static void Where_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Where(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Where_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -63,14 +63,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] public static void Where_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Where_Unordered_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] public static void Where_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -81,7 +81,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] public static void Where_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Where_NotPipelined(labeled, count); @@ -92,7 +92,7 @@ namespace System.Linq.Parallel.Tests // larger input sizes increases the probability that it will. [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Where_Indexed_Unordered(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -106,14 +106,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] public static void Where_Indexed_Unordered_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Where_Indexed_Unordered(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] public static void Where_Indexed(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -127,14 +127,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] public static void Where_Indexed_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Where_Indexed(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(UnorderedSources))] public static void Where_Indexed_Unordered_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -145,14 +145,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(UnorderedSources))] public static void Where_Indexed_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Where_Indexed_Unordered_NotPipelined(labeled, count); } [Theory] - [MemberData("Ranges", (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1, 2, 16 }), MemberType = typeof(Sources))] public static void Where_Indexed_NotPipelined(Labeled<ParallelQuery<int>> labeled, int count) { ParallelQuery<int> query = labeled.Item; @@ -163,7 +163,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("Ranges", (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] + [MemberData(nameof(Sources.Ranges), (object)(new int[] { 1024 * 4, 1024 * 512 }), MemberType = typeof(Sources))] public static void Where_Indexed_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> labeled, int count) { Where_Indexed_NotPipelined(labeled, count); diff --git a/src/System.Linq.Parallel/tests/QueryOperators/ZipTests.cs b/src/System.Linq.Parallel/tests/QueryOperators/ZipTests.cs index 68bb2057fc..9bc2890209 100644 --- a/src/System.Linq.Parallel/tests/QueryOperators/ZipTests.cs +++ b/src/System.Linq.Parallel/tests/QueryOperators/ZipTests.cs @@ -48,7 +48,7 @@ namespace System.Linq.Parallel.Tests } [Theory] - [MemberData("ZipUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ZipUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Zip_Unordered(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -66,14 +66,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ZipUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 64 }))] + [MemberData(nameof(ZipUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 64 }))] public static void Zip_Unordered_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Zip_Unordered(left, leftCount, right, rightCount); } [Theory] - [MemberData("ZipData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ZipData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Zip(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -89,14 +89,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ZipData", (object)(new int[] { 1024 * 4, 1024 * 64 }))] + [MemberData(nameof(ZipData), (object)(new int[] { 1024 * 4, 1024 * 64 }))] public static void Zip_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Zip(left, leftCount, right, rightCount); } [Theory] - [MemberData("ZipUnorderedData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ZipUnorderedData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Zip_Unordered_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -115,14 +115,14 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ZipUnorderedData", (object)(new int[] { 1024 * 4, 1024 * 64 }))] + [MemberData(nameof(ZipUnorderedData), (object)(new int[] { 1024 * 4, 1024 * 64 }))] public static void Zip_Unordered_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Zip_Unordered_NotPipelined(left, leftCount, right, rightCount); } [Theory] - [MemberData("ZipData", (object)(new int[] { 0, 1, 2, 16 }))] + [MemberData(nameof(ZipData), (object)(new int[] { 0, 1, 2, 16 }))] public static void Zip_NotPipelined(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { ParallelQuery<int> leftQuery = left.Item; @@ -139,7 +139,7 @@ namespace System.Linq.Parallel.Tests [Theory] [OuterLoop] - [MemberData("ZipData", (object)(new int[] { 1024 * 4, 1024 * 64 }))] + [MemberData(nameof(ZipData), (object)(new int[] { 1024 * 4, 1024 * 64 }))] public static void Zip_NotPipelined_Longrunning(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount) { Zip_NotPipelined(left, leftCount, right, rightCount); @@ -149,7 +149,7 @@ namespace System.Linq.Parallel.Tests // This is included as a regression test for that particular repro. [Theory] [OuterLoop] - [MemberData("ZipThreadedData", new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })] + [MemberData(nameof(ZipThreadedData), new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })] public static void Zip_AsOrdered_ThreadedDeadlock(Labeled<ParallelQuery<int>> left, int leftCount, Labeled<ParallelQuery<int>> right, int rightCount, int degree) { ParallelQuery<int> query = left.Item.WithDegreeOfParallelism(degree).Zip<int, int, int>(right.Item, (a, b) => { throw new DeliberateTestException(); }); diff --git a/src/System.Linq/tests/CountTests.cs b/src/System.Linq/tests/CountTests.cs index 198a09d2e5..66cb622553 100644 --- a/src/System.Linq/tests/CountTests.cs +++ b/src/System.Linq/tests/CountTests.cs @@ -120,7 +120,7 @@ namespace System.Linq.Tests Assert.Equal(expected, data.Count(IsEven)); } - [Theory, MemberData("CountsAndTallies")] + [Theory, MemberData(nameof(CountsAndTallies))] public void CountMatchesTally<T, TEn>(T unusedArgumentToForceTypeInference, int count, TEn enumerable) where TEn : IEnumerable<T> { diff --git a/src/System.Linq/tests/DistinctTests.cs b/src/System.Linq/tests/DistinctTests.cs index 5c235accd0..d0cdfab12b 100644 --- a/src/System.Linq/tests/DistinctTests.cs +++ b/src/System.Linq/tests/DistinctTests.cs @@ -144,7 +144,7 @@ namespace System.Linq.Tests Assert.Equal(expected, source.Distinct(new AnagramEqualityComparer()), new AnagramEqualityComparer()); } - [Theory, MemberData("SequencesWithDuplicates")] + [Theory, MemberData(nameof(SequencesWithDuplicates))] public void FindDistinctAndValidate<T>(T unusedArgumentToForceTypeInference, IEnumerable<T> original) { // Convert to list to avoid repeated enumerations of the enumerables. diff --git a/src/System.Linq/tests/Performance/Perf.Linq.cs b/src/System.Linq/tests/Performance/Perf.Linq.cs index 5f03f5cbab..55bbdf8da5 100644 --- a/src/System.Linq/tests/Performance/Perf.Linq.cs +++ b/src/System.Linq/tests/Performance/Perf.Linq.cs @@ -56,42 +56,42 @@ namespace System.Linq.Tests #region Perf Tests [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void Select(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.Select(o => o + 1)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void SelectSelect(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.Select(o => o + 1).Select(o => o - 1)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void Where(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.Where(o => o >= 0)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void WhereWhere(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.Where(o => o >= 0).Where(o => o >= -1)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void WhereSelect(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.Where(o => o >= 0).Select(o => o + 1)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void Cast_ToBaseClass(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Func<IEnumerable<ChildClass>, IEnumerable<BaseClass>> linqApply = col => col.Cast<BaseClass>(); @@ -100,7 +100,7 @@ namespace System.Linq.Tests } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void Cast_SameType(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Func<IEnumerable<int>, IEnumerable<int>> linqApply = col => col.Cast<int>(); @@ -109,70 +109,70 @@ namespace System.Linq.Tests } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void OrderBy(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.OrderBy(o => -o)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void OrderByDescending(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.OrderByDescending(o => -o)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void OrderByThenBy(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.OrderBy(o => -o).ThenBy(o => o)); } [Benchmark] - [MemberData("IterationSizeWrapperDataNoWrapper")] + [MemberData(nameof(IterationSizeWrapperDataNoWrapper))] public void Range(int size, int iteration) { Perf_LinqTestBase.Measure<int>(1, iteration, Perf_LinqTestBase.WrapperType.NoWrap, col => Enumerable.Range(0, size)); } [Benchmark] - [MemberData("IterationSizeWrapperDataNoWrapper")] + [MemberData(nameof(IterationSizeWrapperDataNoWrapper))] public void Repeat(int size, int iteration) { Perf_LinqTestBase.Measure<int>(1, iteration, Perf_LinqTestBase.WrapperType.NoWrap, col => Enumerable.Repeat(0, size)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void Reverse(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.Reverse()); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void Skip(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.Skip(1)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void Take(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.Take(size - 1)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void SkipTake(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { Perf_LinqTestBase.Measure<int>(size, iteration, wrapType, col => col.Skip(1).Take(size - 2)); } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void ToArray(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { int[] array = Enumerable.Range(0, size).ToArray(); @@ -180,7 +180,7 @@ namespace System.Linq.Tests } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void ToList(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { int[] array = Enumerable.Range(0, size).ToArray(); @@ -188,7 +188,7 @@ namespace System.Linq.Tests } [Benchmark] - [MemberData("IterationSizeWrapperData")] + [MemberData(nameof(IterationSizeWrapperData))] public void ToDictionary(int size, int iteration, Perf_LinqTestBase.WrapperType wrapType) { int[] array = Enumerable.Range(0, size).ToArray(); diff --git a/src/System.Net.Http.WinHttpHandler/tests/UnitTests/ClientCertificateScenarioTest.cs b/src/System.Net.Http.WinHttpHandler/tests/UnitTests/ClientCertificateScenarioTest.cs index 28fef98bf0..5192485c97 100644 --- a/src/System.Net.Http.WinHttpHandler/tests/UnitTests/ClientCertificateScenarioTest.cs +++ b/src/System.Net.Http.WinHttpHandler/tests/UnitTests/ClientCertificateScenarioTest.cs @@ -49,7 +49,7 @@ namespace System.Net.Http.WinHttpHandlerUnitTests } } - [Theory, MemberData("ValidClientCertificates")] + [Theory, MemberData(nameof(ValidClientCertificates))] public void NonSecureRequest_AddValidCertificate_CertificateContextNotSet(X509Certificate2 certificate) { using (var handler = new WinHttpHandler()) @@ -81,7 +81,7 @@ namespace System.Net.Http.WinHttpHandlerUnitTests } } - [Theory, MemberData("ValidClientCertificates")] + [Theory, MemberData(nameof(ValidClientCertificates))] public void SecureRequest_AddValidCertificate_ValidCertificateContextSet(X509Certificate2 certificate) { using (var handler = new WinHttpHandler()) @@ -98,7 +98,7 @@ namespace System.Net.Http.WinHttpHandlerUnitTests } } - [Theory, MemberData("InvalidClientCertificates")] + [Theory, MemberData(nameof(InvalidClientCertificates))] public void SecureRequest_AddInvalidCertificate_NullCertificateContextSet(X509Certificate2 certificate) { using (var handler = new WinHttpHandler()) diff --git a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs index ef7288e598..20237bfe05 100644 --- a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs +++ b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs @@ -135,7 +135,7 @@ namespace System.Net.Http.Functional.Tests } } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task SendAsync_SimpleGet_Success(Uri remoteServer) { using (var client = new HttpClient()) @@ -202,7 +202,7 @@ namespace System.Net.Http.Functional.Tests } } - [Theory, MemberData("CompressedServers")] + [Theory, MemberData(nameof(CompressedServers))] public async Task GetAsync_DefaultAutomaticDecompression_ContentDecompressed(Uri server) { using (var client = new HttpClient()) @@ -450,7 +450,7 @@ namespace System.Net.Http.Functional.Tests } } - [Theory, MemberData("HeaderValueAndUris")] + [Theory, MemberData(nameof(HeaderValueAndUris))] public async Task GetAsync_RequestHeadersAddCustomHeaders_HeaderAndValueSent(string name, string value, Uri uri) { using (var client = new HttpClient()) @@ -533,7 +533,7 @@ namespace System.Net.Http.Functional.Tests #region Post Methods Tests - [Theory, MemberData("VerifyUploadServers")] + [Theory, MemberData(nameof(VerifyUploadServers))] public async Task PostAsync_CallMethodTwice_StringContent(Uri remoteServer) { using (var client = new HttpClient()) @@ -557,7 +557,7 @@ namespace System.Net.Http.Functional.Tests } } - [Theory, MemberData("VerifyUploadServers")] + [Theory, MemberData(nameof(VerifyUploadServers))] public async Task PostAsync_CallMethod_UnicodeStringContent(Uri remoteServer) { using (var client = new HttpClient()) @@ -573,7 +573,7 @@ namespace System.Net.Http.Functional.Tests } } - [Theory, MemberData("VerifyUploadServersStreamsAndExpectedData")] + [Theory, MemberData(nameof(VerifyUploadServersStreamsAndExpectedData))] public async Task PostAsync_CallMethod_StreamContent(Uri remoteServer, Stream requestContentStream, byte[] expectedData) { using (var client = new HttpClient()) @@ -655,7 +655,7 @@ namespace System.Net.Http.Functional.Tests } } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostAsync_CallMethod_NullContent(Uri remoteServer) { using (var client = new HttpClient()) @@ -675,7 +675,7 @@ namespace System.Net.Http.Functional.Tests } } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostAsync_CallMethod_EmptyContent(Uri remoteServer) { using (var client = new HttpClient()) @@ -737,7 +737,7 @@ namespace System.Net.Http.Functional.Tests #region Various HTTP Method Tests - [Theory, MemberData("HttpMethods")] + [Theory, MemberData(nameof(HttpMethods))] public async Task SendAsync_SendRequestUsingMethodToEchoServerWithNoContent_MethodCorrectlySent( string method, bool secureServer) @@ -755,7 +755,7 @@ namespace System.Net.Http.Functional.Tests } } - [Theory, MemberData("HttpMethodsThatAllowContent")] + [Theory, MemberData(nameof(HttpMethodsThatAllowContent))] public async Task SendAsync_SendRequestUsingMethodToEchoServerWithContent_Success( string method, bool secureServer) @@ -789,28 +789,28 @@ namespace System.Net.Http.Functional.Tests // response version to see if the client sent a particular request version only works // for some servers. In particular the 'Http2Servers' used in these tests always seem // to echo the minor version of the request. - [Theory, MemberData("Http2Servers")] + [Theory, MemberData(nameof(Http2Servers))] public async Task SendAsync_RequestVersion10_ServerReceivesVersion10Request(Uri server) { Version responseVersion = await SendRequestAndGetResponseVersionAsync(new Version(1, 0), server); Assert.Equal(new Version(1, 0), responseVersion); } - [Theory, MemberData("Http2Servers")] + [Theory, MemberData(nameof(Http2Servers))] public async Task SendAsync_RequestVersion11_ServerReceivesVersion11Request(Uri server) { Version responseVersion = await SendRequestAndGetResponseVersionAsync(new Version(1, 1), server); Assert.Equal(new Version(1, 1), responseVersion); } - [Theory, MemberData("Http2Servers")] + [Theory, MemberData(nameof(Http2Servers))] public async Task SendAsync_RequestVersionNotSpecified_ServerReceivesVersion11Request(Uri server) { Version responseVersion = await SendRequestAndGetResponseVersionAsync(null, server); Assert.Equal(new Version(1, 1), responseVersion); } - [Theory, MemberData("Http2Servers")] + [Theory, MemberData(nameof(Http2Servers))] public async Task SendAsync_RequestVersion20_ResponseVersion20IfHttp2Supported(Uri server) { // We don't currently have a good way to test whether HTTP/2 is supported without diff --git a/src/System.Net.Http/tests/FunctionalTests/HttpMethodTest.cs b/src/System.Net.Http/tests/FunctionalTests/HttpMethodTest.cs index 0f11019109..efe95e388c 100644 --- a/src/System.Net.Http/tests/FunctionalTests/HttpMethodTest.cs +++ b/src/System.Net.Http/tests/FunctionalTests/HttpMethodTest.cs @@ -108,7 +108,7 @@ namespace System.Net.Http.Functional.Tests } [Theory] - [MemberData("StaticHttpMethods")] + [MemberData(nameof(StaticHttpMethods))] public void GetHashCode_StaticMethods_SameAsStringToUpperInvariantHashCode(HttpMethod method) { Assert.Equal(method.ToString().ToUpperInvariant().GetHashCode(), method.GetHashCode()); diff --git a/src/System.Net.Http/tests/FunctionalTests/PostScenarioTest.cs b/src/System.Net.Http/tests/FunctionalTests/PostScenarioTest.cs index 295e01ed55..af3b6dfef4 100644 --- a/src/System.Net.Http/tests/FunctionalTests/PostScenarioTest.cs +++ b/src/System.Net.Http/tests/FunctionalTests/PostScenarioTest.cs @@ -43,14 +43,14 @@ namespace System.Net.Http.Functional.Tests _output = output; } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostNoContentUsingContentLengthSemantics_Success(Uri serverUri) { await PostHelper(serverUri, string.Empty, null, useContentLengthUpload: true, useChunkedEncodingUpload: false); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostEmptyContentUsingContentLengthSemantics_Success(Uri serverUri) { await PostHelper(serverUri, string.Empty, new StringContent(string.Empty), @@ -58,56 +58,56 @@ namespace System.Net.Http.Functional.Tests } [ActiveIssue(5485, PlatformID.Windows)] - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostEmptyContentUsingChunkedEncoding_Success(Uri serverUri) { await PostHelper(serverUri, string.Empty, new StringContent(string.Empty), useContentLengthUpload: false, useChunkedEncodingUpload: true); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostUsingContentLengthSemantics_Success(Uri serverUri) { await PostHelper(serverUri, ExpectedContent, new StringContent(ExpectedContent), useContentLengthUpload: true, useChunkedEncodingUpload: false); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostUsingChunkedEncoding_Success(Uri serverUri) { await PostHelper(serverUri, ExpectedContent, new StringContent(ExpectedContent), useContentLengthUpload: false, useChunkedEncodingUpload: true); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostSyncBlockingContentUsingChunkedEncoding_Success(Uri serverUri) { await PostHelper(serverUri, ExpectedContent, new SyncBlockingContent(ExpectedContent), useContentLengthUpload: false, useChunkedEncodingUpload: true); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostRepeatedFlushContentUsingChunkedEncoding_Success(Uri serverUri) { await PostHelper(serverUri, ExpectedContent, new RepeatedFlushContent(ExpectedContent), useContentLengthUpload: false, useChunkedEncodingUpload: true); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostUsingUsingConflictingSemantics_UsesChunkedSemantics(Uri serverUri) { await PostHelper(serverUri, ExpectedContent, new StringContent(ExpectedContent), useContentLengthUpload: true, useChunkedEncodingUpload: true); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task PostUsingNoSpecifiedSemantics_UsesChunkedSemantics(Uri serverUri) { await PostHelper(serverUri, ExpectedContent, new StringContent(ExpectedContent), useContentLengthUpload: false, useChunkedEncodingUpload: false); } - [Theory, MemberData("BasicAuthEchoServers")] + [Theory, MemberData(nameof(BasicAuthEchoServers))] public async Task PostRewindableContentUsingAuth_NoPreAuthenticate_Success(Uri serverUri) { HttpContent content = CustomContent.Create(ExpectedContent, true); @@ -115,7 +115,7 @@ namespace System.Net.Http.Functional.Tests await PostUsingAuthHelper(serverUri, ExpectedContent, content, credential, false); } - [Theory, MemberData("BasicAuthEchoServers")] + [Theory, MemberData(nameof(BasicAuthEchoServers))] public async Task PostNonRewindableContentUsingAuth_NoPreAuthenticate_ThrowsInvalidOperationException(Uri serverUri) { HttpContent content = CustomContent.Create(ExpectedContent, false); @@ -124,7 +124,7 @@ namespace System.Net.Http.Functional.Tests PostUsingAuthHelper(serverUri, ExpectedContent, content, credential, preAuthenticate: false)); } - [Theory, MemberData("BasicAuthEchoServers")] + [Theory, MemberData(nameof(BasicAuthEchoServers))] public async Task PostNonRewindableContentUsingAuth_PreAuthenticate_Success(Uri serverUri) { HttpContent content = CustomContent.Create(ExpectedContent, false); diff --git a/src/System.Net.Http/tests/UnitTests/Headers/CurlResponseParseUtilsTest.cs b/src/System.Net.Http/tests/UnitTests/Headers/CurlResponseParseUtilsTest.cs index 99db6c615e..75aadb2e46 100644 --- a/src/System.Net.Http/tests/UnitTests/Headers/CurlResponseParseUtilsTest.cs +++ b/src/System.Net.Http/tests/UnitTests/Headers/CurlResponseParseUtilsTest.cs @@ -60,7 +60,7 @@ namespace System.Net.Http.Tests } #region StatusCode - [Theory, MemberData("ValidStatusCodeLines")] + [Theory, MemberData(nameof(ValidStatusCodeLines))] public void ReadStatusLine_ValidStatusCode_ResponseMessageValueSet(string statusLine, HttpStatusCode expectedCode, string expectedPhrase) { HttpResponseMessage response = new HttpResponseMessage(); @@ -69,14 +69,14 @@ namespace System.Net.Http.Tests Assert.Equal<string>(expectedPhrase, response.ReasonPhrase); } - [Theory, MemberData("InvalidStatusCodeLines")] + [Theory, MemberData(nameof(InvalidStatusCodeLines))] public void ReadStatusLine_InvalidStatusCode_ThrowsHttpRequestException(string statusLine, HttpStatusCode expectedCode, string phrase) { HttpResponseMessage response = new HttpResponseMessage(); Assert.Throws<HttpRequestException>(() => CurlResponseParseUtils.ReadStatusLine(response, statusLine)); } - [Theory, MemberData("StatusCodeVersionLines")] + [Theory, MemberData(nameof(StatusCodeVersionLines))] public void ReadStatusLine_ValidStatusCodeLine_ResponseMessageVersionSet(string statusLine, int major, int minor) { HttpResponseMessage response = new HttpResponseMessage(); @@ -124,7 +124,7 @@ namespace System.Net.Http.Tests Assert.Null(CurlResponseParseUtils.ReadHeaderName(string.Empty, out index)); } - [Theory, MemberData("InvalidHeaderLines")] + [Theory, MemberData(nameof(InvalidHeaderLines))] public void ReadHeaderName_InvalidHeaderLine_ThrowsHttpRequestException(string headerLine) { int index; diff --git a/src/System.Net.Primitives/tests/FunctionalTests/IPAddressTest.cs b/src/System.Net.Primitives/tests/FunctionalTests/IPAddressTest.cs index bdd8b58d10..3845dd19a2 100644 --- a/src/System.Net.Primitives/tests/FunctionalTests/IPAddressTest.cs +++ b/src/System.Net.Primitives/tests/FunctionalTests/IPAddressTest.cs @@ -58,7 +58,7 @@ namespace System.Net.Primitives.Functional.Tests } [Theory] - [MemberData("AddressBytesAndFamilies")] + [MemberData(nameof(AddressBytesAndFamilies))] public static void Ctor_Bytes_Success(byte[] address, AddressFamily expectedFamily) { IPAddress ip = new IPAddress(address); @@ -81,7 +81,7 @@ namespace System.Net.Primitives.Functional.Tests } [Theory] - [MemberData("IPv6AddressBytesAndScopeIds")] + [MemberData(nameof(IPv6AddressBytesAndScopeIds))] public static void Ctor_BytesScopeId_Success(byte[] address, long scopeId) { IPAddress ip = new IPAddress(address, scopeId); diff --git a/src/System.Net.Primitives/tests/PalTests/IPAddressPalTest.cs b/src/System.Net.Primitives/tests/PalTests/IPAddressPalTest.cs index 6122aa86c0..911fb94eec 100644 --- a/src/System.Net.Primitives/tests/PalTests/IPAddressPalTest.cs +++ b/src/System.Net.Primitives/tests/PalTests/IPAddressPalTest.cs @@ -115,7 +115,7 @@ namespace System.Net.Primitives.PalTests new object[] { new byte[] { 255, 255, 255, 255 }, "255.255.255.255" } }; - [Theory, MemberData("ValidIPv4Addresses")] + [Theory, MemberData(nameof(ValidIPv4Addresses))] public void IPv4AddressToString_Valid(byte[] bytes, string addressString) { var buffer = new StringBuilder(IPAddressParser.INET_ADDRSTRLEN); @@ -124,7 +124,7 @@ namespace System.Net.Primitives.PalTests Assert.Equal(addressString, buffer.ToString()); } - [Theory, MemberData("ValidIPv4Addresses")] + [Theory, MemberData(nameof(ValidIPv4Addresses))] public void IPv4AddressToString_RoundTrip(byte[] bytes, string addressString) { var buffer = new StringBuilder(IPAddressParser.INET_ADDRSTRLEN); @@ -145,7 +145,7 @@ namespace System.Net.Primitives.PalTests Assert.Equal(0, port); } - [Theory, MemberData("ValidIPv4Addresses")] + [Theory, MemberData(nameof(ValidIPv4Addresses))] public void IPv4StringToAddress_RoundTrip(byte[] bytes, string addressString) { var actualBytes = new byte[IPAddressParserStatics.IPv4AddressBytes]; @@ -362,7 +362,7 @@ namespace System.Net.Primitives.PalTests } }; - [Theory, MemberData("ValidIPv6Addresses")] + [Theory, MemberData(nameof(ValidIPv6Addresses))] public void IPv6AddressToString_Valid(byte[] bytes, string addressString) { var buffer = new StringBuilder(IPAddressParser.INET6_ADDRSTRLEN); @@ -371,7 +371,7 @@ namespace System.Net.Primitives.PalTests Assert.Equal(addressString, buffer.ToString()); } - [Theory, MemberData("ValidIPv6Addresses")] + [Theory, MemberData(nameof(ValidIPv6Addresses))] public void IPv6AddressToString_RoundTrip(byte[] bytes, string addressString) { var buffer = new StringBuilder(IPAddressParser.INET6_ADDRSTRLEN); @@ -392,7 +392,7 @@ namespace System.Net.Primitives.PalTests Assert.Equal(0, (int)scope); } - [Theory, MemberData("ValidIPv6Addresses")] + [Theory, MemberData(nameof(ValidIPv6Addresses))] public void IPv6StringToAddress_RoundTrip(byte[] bytes, string addressString) { var actualBytes = new byte[IPAddressParserStatics.IPv6AddressBytes]; diff --git a/src/System.Net.Primitives/tests/PalTests/SocketAddressPalTest.cs b/src/System.Net.Primitives/tests/PalTests/SocketAddressPalTest.cs index be606825b7..8b731c22af 100644 --- a/src/System.Net.Primitives/tests/PalTests/SocketAddressPalTest.cs +++ b/src/System.Net.Primitives/tests/PalTests/SocketAddressPalTest.cs @@ -20,7 +20,7 @@ namespace System.Net.Primitives.PalTests new object[] { AddressFamily.InterNetworkV6 } }; - [Theory, MemberData("AddressFamilyData")] + [Theory, MemberData(nameof(AddressFamilyData))] public void AddressFamily_Get_Set(AddressFamily family) { var buffer = new byte[16]; @@ -43,7 +43,7 @@ namespace System.Net.Primitives.PalTests new object[] { (ushort)65535 } }; - [Theory, MemberData("PortData")] + [Theory, MemberData(nameof(PortData))] public void Port_Get_Set_IPv4(ushort port) { var buffer = new byte[SocketAddressPal.IPv4AddressSize]; @@ -52,7 +52,7 @@ namespace System.Net.Primitives.PalTests Assert.Equal(port, SocketAddressPal.GetPort(buffer)); } - [Theory, MemberData("PortData")] + [Theory, MemberData(nameof(PortData))] public void Port_Get_Set_IPv6(ushort port) { var buffer = new byte[SocketAddressPal.IPv6AddressSize]; @@ -86,7 +86,7 @@ namespace System.Net.Primitives.PalTests new object[] { 0xFFFFFFFF } }; - [Theory, MemberData("IPv4AddressData")] + [Theory, MemberData(nameof(IPv4AddressData))] public void IPv4Address_Get_Set(uint address) { var buffer = new byte[SocketAddressPal.IPv4AddressSize]; @@ -123,7 +123,7 @@ namespace System.Net.Primitives.PalTests } }; - [Theory, MemberData("IPv6AddressData")] + [Theory, MemberData(nameof(IPv6AddressData))] public void IPv6Address_Get_Set(byte[] address, uint scope) { var buffer = new byte[SocketAddressPal.IPv6AddressSize]; @@ -154,7 +154,7 @@ namespace System.Net.Primitives.PalTests public static IEnumerable<object[]> IPv4AddressAndPortData = IPv4AddressData.SelectMany(o => PortData.Select(p => o.Concat(p))).Select(o => o.ToArray()); - [Theory, MemberData("IPv4AddressAndPortData")] + [Theory, MemberData(nameof(IPv4AddressAndPortData))] public void IPv4AddressAndPort_Get_Set(uint address, ushort port) { var buffer = new byte[SocketAddressPal.IPv4AddressSize]; @@ -168,7 +168,7 @@ namespace System.Net.Primitives.PalTests public static IEnumerable<object[]> IPv6AddressAndPortData = IPv6AddressData.SelectMany(o => PortData.Select(p => o.Concat(p))).Select(o => o.ToArray()); - [Theory, MemberData("IPv6AddressAndPortData")] + [Theory, MemberData(nameof(IPv6AddressAndPortData))] public void IPv6AddressAndPort_Get_Set(byte[] address, uint scope, ushort port) { var buffer = new byte[SocketAddressPal.IPv6AddressSize]; diff --git a/src/System.Net.Requests/tests/HttpWebRequestTest.cs b/src/System.Net.Requests/tests/HttpWebRequestTest.cs index 7e5ff05137..96bc9499ce 100644 --- a/src/System.Net.Requests/tests/HttpWebRequestTest.cs +++ b/src/System.Net.Requests/tests/HttpWebRequestTest.cs @@ -34,7 +34,7 @@ namespace System.Net.Tests _output = output; } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Ctor_VerifyDefaults_Success(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -54,7 +54,7 @@ namespace System.Net.Tests Assert.False(request.UseDefaultCredentials); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Ctor_CreateHttpWithString_ExpectNotNull(Uri remoteServer) { string remoteServerString = remoteServer.ToString(); @@ -62,14 +62,14 @@ namespace System.Net.Tests Assert.NotNull(request); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Ctor_CreateHttpWithUri_ExpectNotNull(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); Assert.NotNull(request); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Accept_SetThenGetValidValue_ExpectSameValue(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -78,7 +78,7 @@ namespace System.Net.Tests Assert.Equal(acceptType, request.Accept); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Accept_SetThenGetEmptyValue_ExpectNull(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -86,7 +86,7 @@ namespace System.Net.Tests Assert.Null(request.Accept); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Accept_SetThenGetNullValue_ExpectNull(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -94,7 +94,7 @@ namespace System.Net.Tests Assert.Null(request.Accept); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void AllowReadStreamBuffering_SetFalseThenGet_ExpectFalse(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -102,7 +102,7 @@ namespace System.Net.Tests Assert.False(request.AllowReadStreamBuffering); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void AllowReadStreamBuffering_SetTrueThenGet_ExpectTrue(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -110,7 +110,7 @@ namespace System.Net.Tests Assert.True(request.AllowReadStreamBuffering); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task ContentLength_Get_ExpectSameAsGetResponseStream(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -125,7 +125,7 @@ namespace System.Net.Tests Assert.Equal(strContent.Length, length); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void ContentType_SetThenGet_ExpectSameValue(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -134,7 +134,7 @@ namespace System.Net.Tests Assert.Equal(myContent, request.ContentType); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void ContentType_SetThenGetEmptyValue_ExpectNull(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -142,7 +142,7 @@ namespace System.Net.Tests Assert.Null(request.ContentType); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void ContinueTimeout_SetThenGetZero_ExpectZero(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -150,21 +150,21 @@ namespace System.Net.Tests Assert.Equal(0, request.ContinueTimeout); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void ContinueTimeout_SetNegativeOne_Success(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); request.ContinueTimeout = -1; } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void ContinueTimeout_SetNegativeTwo_ThrowsArgumentOutOfRangeException(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); Assert.Throws<ArgumentOutOfRangeException>(() => request.ContinueTimeout = -2); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Credentials_SetDefaultCredentialsThenGet_ValuesMatch(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -172,7 +172,7 @@ namespace System.Net.Tests Assert.Equal(CredentialCache.DefaultCredentials, request.Credentials); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Credentials_SetExplicitCredentialsThenGet_ValuesMatch(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -180,7 +180,7 @@ namespace System.Net.Tests Assert.Equal(_explicitCredential, request.Credentials); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void UseDefaultCredentials_SetTrue_CredentialsEqualsDefaultCredentials(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -189,7 +189,7 @@ namespace System.Net.Tests Assert.Equal(CredentialCache.DefaultCredentials, request.Credentials); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void UseDefaultCredentials_SetFalse_CredentialsNull(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -198,7 +198,7 @@ namespace System.Net.Tests Assert.Equal(null, request.Credentials); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void BeginGetRequestStream_UseGETVerb_ThrowsProtocolViolationException(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -208,7 +208,7 @@ namespace System.Net.Tests }); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void BeginGetRequestStream_UseHEADVerb_ThrowsProtocolViolationException(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -219,7 +219,7 @@ namespace System.Net.Tests }); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void BeginGetRequestStream_UseCONNECTVerb_ThrowsProtocolViolationException(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -230,7 +230,7 @@ namespace System.Net.Tests }); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void BeginGetRequestStream_CreatePostRequestThenAbort_ThrowsWebException(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -240,7 +240,7 @@ namespace System.Net.Tests Assert.Equal(WebExceptionStatus.RequestCanceled, ex.Status); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void BeginGetRequestStream_CreatePostRequestThenCallTwice_ThrowsInvalidOperationException(Uri remoteServer) { _savedHttpWebRequest = HttpWebRequest.CreateHttp(remoteServer); @@ -253,7 +253,7 @@ namespace System.Net.Tests }); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void BeginGetRequestStream_CreateRequestThenBeginGetResponsePrior_ThrowsInvalidOperationException(Uri remoteServer) { _savedHttpWebRequest = HttpWebRequest.CreateHttp(remoteServer); @@ -265,7 +265,7 @@ namespace System.Net.Tests }); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void BeginGetResponse_CreateRequestThenCallTwice_ThrowsInvalidOperationException(Uri remoteServer) { _savedHttpWebRequest = HttpWebRequest.CreateHttp(remoteServer); @@ -277,7 +277,7 @@ namespace System.Net.Tests }); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void BeginGetResponse_CreatePostRequestThenAbort_ThrowsWebException(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -287,7 +287,7 @@ namespace System.Net.Tests Assert.Equal(WebExceptionStatus.RequestCanceled, ex.Status); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task GetRequestStreamAsync_WriteAndDisposeRequestStreamThenOpenRequestStream_ThrowsArgumentException(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -303,7 +303,7 @@ namespace System.Net.Tests }); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task GetRequestStreamAsync_SetPOSTThenGet_ExpectNotNull(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -312,7 +312,7 @@ namespace System.Net.Tests Assert.NotNull(requestStream); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task GetResponseAsync_GetResponseStream_ExpectNotNull(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -320,7 +320,7 @@ namespace System.Net.Tests Assert.NotNull(response.GetResponseStream()); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task GetResponseAsync_GetResponseStream_ContainsHost(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -336,7 +336,7 @@ namespace System.Net.Tests Assert.True(strContent.Contains("\"Host\": \"" + HttpTestServers.Host + "\"")); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task GetResponseAsync_PostRequestStream_ContainsData(Uri remoteServer) { HttpWebRequest request = HttpWebRequest.CreateHttp(remoteServer); @@ -355,7 +355,7 @@ namespace System.Net.Tests Assert.True(strContent.Contains(RequestBody)); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task GetResponseAsync_UseDefaultCredentials_ExpectSuccess(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -379,7 +379,7 @@ namespace System.Net.Tests new object[] { HttpTestServers.StatusCodeUri(true, 404) }, }; - [Theory, MemberData("StatusCodeServers")] + [Theory, MemberData(nameof(StatusCodeServers))] public async Task GetResponseAsync_ResourceNotFound_ThrowsWebException(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -389,7 +389,7 @@ namespace System.Net.Tests } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task HaveResponse_GetResponseAsync_ExpectTrue(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -397,7 +397,7 @@ namespace System.Net.Tests Assert.True(request.HaveResponse); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task Headers_GetResponseHeaders_ContainsExpectedValue(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -407,7 +407,7 @@ namespace System.Net.Tests Assert.True(headersString.Contains(headersPartialContent)); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Method_SetThenGetToGET_ExpectSameValue(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -415,7 +415,7 @@ namespace System.Net.Tests Assert.Equal(HttpMethod.Get.Method, request.Method); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Method_SetThenGetToPOST_ExpectSameValue(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -423,21 +423,21 @@ namespace System.Net.Tests Assert.Equal(HttpMethod.Post.Method, request.Method); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Proxy_GetDefault_ExpectNotNull(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); Assert.NotNull(request.Proxy); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void RequestUri_CreateHttpThenGet_ExpectSameUri(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); Assert.Equal(remoteServer, request.RequestUri); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task ResponseUri_GetResponseAsync_ExpectSameUri(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); @@ -445,14 +445,14 @@ namespace System.Net.Tests Assert.Equal(remoteServer, response.ResponseUri); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void SupportsCookieContainer_GetDefault_ExpectTrue(Uri remoteServer) { HttpWebRequest request = WebRequest.CreateHttp(remoteServer); Assert.True(request.SupportsCookieContainer); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task SimpleScenario_UseGETVerb_Success(Uri remoteServer) { HttpWebRequest request = HttpWebRequest.CreateHttp(remoteServer); @@ -467,7 +467,7 @@ namespace System.Net.Tests Assert.Equal(HttpStatusCode.OK, response.StatusCode); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task SimpleScenario_UsePOSTVerb_Success(Uri remoteServer) { HttpWebRequest request = HttpWebRequest.CreateHttp(remoteServer); @@ -490,7 +490,7 @@ namespace System.Net.Tests Assert.Equal(HttpStatusCode.OK, response.StatusCode); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public async Task ContentType_AddHeaderWithNoContent_SendRequest_HeaderGetsSent(Uri remoteServer) { HttpWebRequest request = HttpWebRequest.CreateHttp(remoteServer); @@ -509,7 +509,7 @@ namespace System.Net.Tests Assert.True(responseBody.Contains("Content-Type")); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Abort_BeginGetRequestStreamThenAbort_EndGetRequestStreamThrowsWebException(Uri remoteServer) { _savedHttpWebRequest = HttpWebRequest.CreateHttp(remoteServer); @@ -523,7 +523,7 @@ namespace System.Net.Tests Assert.Equal(WebExceptionStatus.RequestCanceled, wex.Status); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Abort_BeginGetResponseThenAbort_ResponseCallbackCalledBeforeAbortReturns(Uri remoteServer) { _savedHttpWebRequest = HttpWebRequest.CreateHttp(remoteServer); @@ -534,7 +534,7 @@ namespace System.Net.Tests Assert.Equal(1, _responseCallbackCallCount); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Abort_BeginGetResponseThenAbort_EndGetResponseThrowsWebException(Uri remoteServer) { _savedHttpWebRequest = HttpWebRequest.CreateHttp(remoteServer); @@ -546,7 +546,7 @@ namespace System.Net.Tests Assert.Equal(WebExceptionStatus.RequestCanceled, wex.Status); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Abort_BeginGetResponseUsingNoCallbackThenAbort_Success(Uri remoteServer) { _savedHttpWebRequest = HttpWebRequest.CreateHttp(remoteServer); @@ -556,7 +556,7 @@ namespace System.Net.Tests _savedHttpWebRequest.Abort(); } - [Theory, MemberData("EchoServers")] + [Theory, MemberData(nameof(EchoServers))] public void Abort_CreateRequestThenAbort_Success(Uri remoteServer) { _savedHttpWebRequest = HttpWebRequest.CreateHttp(remoteServer); diff --git a/src/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs b/src/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs index fd9c660872..baa8fa7081 100644 --- a/src/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs +++ b/src/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs @@ -54,7 +54,7 @@ namespace System.Net.Security.Tests } [Theory] - [MemberData("ProtocolMismatchData")] + [MemberData(nameof(ProtocolMismatchData))] public async Task ClientAsyncAuthenticate_MismatchProtocols_Fails( SslProtocols serverProtocol, SslProtocols clientProtocol, diff --git a/src/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs b/src/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs index b423600e27..865f048822 100644 --- a/src/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs +++ b/src/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs @@ -46,7 +46,7 @@ namespace System.Net.Security.Tests } [Theory] - [MemberData("ProtocolMismatchData")] + [MemberData(nameof(ProtocolMismatchData))] public async Task ServerAsyncAuthenticate_MismatchProtocols_Fails( SslProtocols serverProtocol, SslProtocols clientProtocol, diff --git a/src/System.Net.Sockets/tests/FunctionalTests/CreateSocketTests.cs b/src/System.Net.Sockets/tests/FunctionalTests/CreateSocketTests.cs index b218631845..1ff04a43b8 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/CreateSocketTests.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/CreateSocketTests.cs @@ -31,7 +31,7 @@ namespace System.Net.Sockets.Tests */ }; - [Theory, MemberData("DualModeSuccessInputs")] + [Theory, MemberData(nameof(DualModeSuccessInputs))] public void DualMode_Success(SocketType socketType, ProtocolType protocolType) { using (new Socket(socketType, protocolType)) @@ -39,7 +39,7 @@ namespace System.Net.Sockets.Tests } } - [Theory, MemberData("DualModeFailureInputs")] + [Theory, MemberData(nameof(DualModeFailureInputs))] public void DualMode_Failure(SocketType socketType, ProtocolType protocolType) { Assert.Throws<SocketException>(() => new Socket(socketType, protocolType)); @@ -52,7 +52,7 @@ namespace System.Net.Sockets.Tests new object[] { AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp }, }; - [Theory, MemberData("CtorSuccessInputs")] + [Theory, MemberData(nameof(CtorSuccessInputs))] public void Ctor_Success(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType) { using (new Socket(addressFamily, socketType, protocolType)) @@ -79,7 +79,7 @@ namespace System.Net.Sockets.Tests */ }; - [Theory, MemberData("CtorFailureInputs")] + [Theory, MemberData(nameof(CtorFailureInputs))] public void Ctor_Failure(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType) { Assert.Throws<SocketException>(() => new Socket(addressFamily, socketType, protocolType)); diff --git a/src/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs index 4a298d0038..598afb2e34 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs @@ -138,7 +138,7 @@ namespace System.Net.Sockets.Tests #region ConnectAsync to DnsEndPoint [Theory] - [MemberData("DualMode_Connect_IPAddress_DualMode_Data")] + [MemberData(nameof(DualMode_Connect_IPAddress_DualMode_Data))] [PlatformSpecific(PlatformID.Windows)] public void DualModeConnectAsync_DnsEndPointToHost_Helper(IPAddress listenOn, bool dualModeServer) { diff --git a/src/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs index 3f76827f97..7927a545fb 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs @@ -11,7 +11,7 @@ namespace System.Net.Sockets.Tests public class NetworkStreamTest { [Theory] - [MemberData("NonCanceledTokens")] + [MemberData(nameof(NonCanceledTokens))] public async Task ReadWriteAsync_NonCanceled_Success(CancellationToken nonCanceledToken) { await RunWithConnectedNetworkStreamsAsync(async (server, client) => diff --git a/src/System.Net.WebHeaderCollection/tests/WebHeaderCollectionTest.cs b/src/System.Net.WebHeaderCollection/tests/WebHeaderCollectionTest.cs index 8f1cc5a939..4614072f09 100644 --- a/src/System.Net.WebHeaderCollection/tests/WebHeaderCollectionTest.cs +++ b/src/System.Net.WebHeaderCollection/tests/WebHeaderCollectionTest.cs @@ -143,7 +143,7 @@ namespace System.Net.WebHeaderCollectionTests new object[] { "\u0019" } }; - [Theory, MemberData("InvalidNames")] + [Theory, MemberData(nameof(InvalidNames))] public void CheckBadChars_InvalidName(string name) { WebHeaderCollection w = new WebHeaderCollection(); @@ -158,7 +158,7 @@ namespace System.Net.WebHeaderCollectionTests new object[] { "value1\u0019value2" } }; - [Theory, MemberData("InvalidValues")] + [Theory, MemberData(nameof(InvalidValues))] public void CheckBadChars_InvalidValue(string value) { WebHeaderCollection w = new WebHeaderCollection(); @@ -172,7 +172,7 @@ namespace System.Net.WebHeaderCollectionTests new object[] { "value1\r\n value2" } }; - [Theory, MemberData("ValidValues")] + [Theory, MemberData(nameof(ValidValues))] public void CheckBadChars_ValidValue(string value) { WebHeaderCollection w = new WebHeaderCollection(); @@ -224,7 +224,7 @@ namespace System.Net.WebHeaderCollectionTests }; [Theory] - [MemberData("TestHeadersWithValues")] + [MemberData(nameof(TestHeadersWithValues))] public void GetValues_String_Success(string header, string value, string[] expectedValues) { WebHeaderCollection w = new WebHeaderCollection(); diff --git a/src/System.Net.WebSockets.Client/tests/ClientWebSocketTest.cs b/src/System.Net.WebSockets.Client/tests/ClientWebSocketTest.cs index d1b14d063d..bec96b931e 100644 --- a/src/System.Net.WebSockets.Client/tests/ClientWebSocketTest.cs +++ b/src/System.Net.WebSockets.Client/tests/ClientWebSocketTest.cs @@ -54,7 +54,7 @@ namespace System.Net.WebSockets.Client.Tests private static bool WebSocketsSupported { get { return WebSocketHelper.WebSocketsSupported; } } #region Connect - [ConditionalTheory("WebSocketsSupported"), MemberData("UnavailableWebSocketServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(UnavailableWebSocketServers))] public async Task ConnectAsync_NotWebSocketServer_ThrowsWebSocketExceptionWithMessage(Uri server) { using (var cws = new ClientWebSocket()) @@ -69,19 +69,19 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task EchoBinaryMessage_Success(Uri server) { await WebSocketHelper.TestEcho(server, WebSocketMessageType.Binary, TimeOutMilliseconds, _output); } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task EchoTextMessage_Success(Uri server) { await WebSocketHelper.TestEcho(server, WebSocketMessageType.Text, TimeOutMilliseconds, _output); } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoHeadersServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoHeadersServers))] public async Task ConnectAsync_AddCustomHeaders_Success(Uri server) { using (var cws = new ClientWebSocket()) @@ -118,7 +118,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task ConnectAsync_PassNoSubProtocol_ServerRequires_ThrowsWebSocketExceptionWithMessage(Uri server) { const string AcceptedProtocol = "CustomProtocol"; @@ -139,7 +139,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task ConnectAsync_PassMultipleSubProtocols_ServerRequires_ConnectionUsesAgreedSubProtocol(Uri server) { const string AcceptedProtocol = "AcceptedProtocol"; @@ -162,7 +162,7 @@ namespace System.Net.WebSockets.Client.Tests #endregion #region SendReceive - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task SendReceive_PartialMessage_Success(Uri server) { var sendBuffer = new byte[1024]; @@ -196,7 +196,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task SendAsync_SendCloseMessageType_ThrowsArgumentExceptionWithMessage(Uri server) { using (ClientWebSocket cws = await WebSocketHelper.GetConnectedWebSocket(server, TimeOutMilliseconds, _output)) @@ -221,7 +221,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task SendAsync__MultipleOutstandingSendOperations_Throws(Uri server) { using (ClientWebSocket cws = await WebSocketHelper.GetConnectedWebSocket(server, TimeOutMilliseconds, _output)) @@ -278,7 +278,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task ReceiveAsync_MultipleOutstandingReceiveOperations_Throws(Uri server) { using (ClientWebSocket cws = await WebSocketHelper.GetConnectedWebSocket(server, TimeOutMilliseconds, _output)) @@ -339,7 +339,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task SendAsync_SendZeroLengthPayloadAsEndOfMessage_Success(Uri server) { using (ClientWebSocket cws = await WebSocketHelper.GetConnectedWebSocket(server, TimeOutMilliseconds, _output)) @@ -376,7 +376,7 @@ namespace System.Net.WebSockets.Client.Tests #endregion #region Close - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseAsync_ServerInitiatedClose_Success(Uri server) { const string closeWebSocketMetaCommand = ".close"; @@ -420,7 +420,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseAsync_ClientInitiatedClose_Success(Uri server) { using (ClientWebSocket cws = await WebSocketHelper.GetConnectedWebSocket(server, TimeOutMilliseconds, _output)) @@ -439,7 +439,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseAsync_CloseDescriptionIsMaxLength_Success(Uri server) { string closeDescription = new string('C', CloseDescriptionMaxLength); @@ -452,7 +452,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseAsync_CloseDescriptionIsMaxLengthPlusOne_ThrowsArgumentException(Uri server) { string closeDescription = new string('C', CloseDescriptionMaxLength + 1); @@ -476,7 +476,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseAsync_CloseDescriptionHasUnicode_Success(Uri server) { using (ClientWebSocket cws = await WebSocketHelper.GetConnectedWebSocket(server, TimeOutMilliseconds, _output)) @@ -493,7 +493,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseAsync_CloseDescriptionIsNull_Success(Uri server) { using (ClientWebSocket cws = await WebSocketHelper.GetConnectedWebSocket(server, TimeOutMilliseconds, _output)) @@ -509,7 +509,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseOutputAsync_ClientInitiated_CanReceive_CanClose(Uri server) { string message = "Hello WebSockets!"; @@ -546,7 +546,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseOutputAsync_ServerInitiated_CanSend(Uri server) { string message = "Hello WebSockets!"; @@ -592,7 +592,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseOutputAsync_CloseDescriptionIsNull_Success(Uri server) { using (ClientWebSocket cws = await WebSocketHelper.GetConnectedWebSocket(server, TimeOutMilliseconds, _output)) @@ -608,7 +608,7 @@ namespace System.Net.WebSockets.Client.Tests #endregion #region Abort - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public void Abort_ConnectAndAbort_ThrowsWebSocketExceptionWithmessage(Uri server) { using (var cws = new ClientWebSocket()) @@ -629,7 +629,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task Abort_SendAndAbort_Success(Uri server) { await TestCancellation(async (cws) => { @@ -647,7 +647,7 @@ namespace System.Net.WebSockets.Client.Tests }, server); } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task Abort_ReceiveAndAbort_Success(Uri server) { await TestCancellation(async (cws) => { @@ -669,7 +669,7 @@ namespace System.Net.WebSockets.Client.Tests }, server); } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task Abort_CloseAndAbort_Success(Uri server) { await TestCancellation(async (cws) => { @@ -691,7 +691,7 @@ namespace System.Net.WebSockets.Client.Tests }, server); } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task ClientWebSocket_Abort_CloseOutputAsync(Uri server) { await TestCancellation(async (cws) => { @@ -715,7 +715,7 @@ namespace System.Net.WebSockets.Client.Tests #endregion #region Cancellation - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task ConnectAsync_Cancel_ThrowsWebSocketExceptionWithMessage(Uri server) { using (var cws = new ClientWebSocket()) @@ -735,7 +735,7 @@ namespace System.Net.WebSockets.Client.Tests } } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task SendAsync_Cancel_Success(Uri server) { await TestCancellation((cws) => { @@ -748,7 +748,7 @@ namespace System.Net.WebSockets.Client.Tests }, server); } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task ReceiveAsync_Cancel_Success(Uri server) { await TestCancellation(async (cws) => { @@ -768,7 +768,7 @@ namespace System.Net.WebSockets.Client.Tests }, server); } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseAsync_Cancel_Success(Uri server) { await TestCancellation(async (cws) => { @@ -788,7 +788,7 @@ namespace System.Net.WebSockets.Client.Tests }, server); } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task CloseOutputAsync_Cancel_Success(Uri server) { await TestCancellation(async (cws) => { @@ -809,7 +809,7 @@ namespace System.Net.WebSockets.Client.Tests }, server); } - [ConditionalTheory("WebSocketsSupported"), MemberData("EchoServers")] + [ConditionalTheory("WebSocketsSupported"), MemberData(nameof(EchoServers))] public async Task ReceiveAsync_CancelAndReceive_ThrowsWebSocketExceptionWithMessage(Uri server) { using (ClientWebSocket cws = await WebSocketHelper.GetConnectedWebSocket(server, TimeOutMilliseconds, _output)) diff --git a/src/System.Net.WebSockets/tests/WebSocketExceptionTests.cs b/src/System.Net.WebSockets/tests/WebSocketExceptionTests.cs index 99b7282e0a..d00ea840dd 100644 --- a/src/System.Net.WebSockets/tests/WebSocketExceptionTests.cs +++ b/src/System.Net.WebSockets/tests/WebSocketExceptionTests.cs @@ -31,7 +31,7 @@ namespace System.Net.WebSockets.Tests public static object[][] UnrelatedErrorData = ErrorData.SelectMany(wse => NativeErrorData.Select(ne => new object[] { wse[0], ne[0] })).ToArray(); - [Theory, MemberData("ErrorData")] + [Theory, MemberData(nameof(ErrorData))] public void ConstructorTests_WebSocketError_Success(WebSocketError error) { var wse = new WebSocketException(error); @@ -40,7 +40,7 @@ namespace System.Net.WebSockets.Tests Assert.Null(wse.InnerException); } - [Theory, MemberData("ErrorData")] + [Theory, MemberData(nameof(ErrorData))] public void ConstructorTests_WebSocketError_Message_Success(WebSocketError error) { const string Message = "Message"; @@ -50,7 +50,7 @@ namespace System.Net.WebSockets.Tests Assert.Null(wse.InnerException); } - [Theory, MemberData("ErrorData")] + [Theory, MemberData(nameof(ErrorData))] public void ConstructorTests_WebSocketError_Exception_Success(WebSocketError error) { var inner = new Exception(); @@ -60,7 +60,7 @@ namespace System.Net.WebSockets.Tests Assert.Equal(wse.InnerException, inner); } - [Theory, MemberData("ErrorData")] + [Theory, MemberData(nameof(ErrorData))] public void ConstructorTests_WebSocketError_Message_Exception_Success(WebSocketError error) { const string Message = "Message"; @@ -71,7 +71,7 @@ namespace System.Net.WebSockets.Tests Assert.Equal(wse.InnerException, inner); } - [Theory, MemberData("NativeErrorData")] + [Theory, MemberData(nameof(NativeErrorData))] public void ConstructorTests_NativeError_Success(int nativeError, WebSocketError webSocketError) { var wse = new WebSocketException(nativeError); @@ -81,7 +81,7 @@ namespace System.Net.WebSockets.Tests Assert.Null(wse.InnerException); } - [Theory, MemberData("NativeErrorData")] + [Theory, MemberData(nameof(NativeErrorData))] public void ConstructorTests_NativeError_Message_Success(int nativeError, WebSocketError webSocketError) { const string Message = "Message"; @@ -92,7 +92,7 @@ namespace System.Net.WebSockets.Tests Assert.Null(wse.InnerException); } - [Theory, MemberData("NativeErrorData")] + [Theory, MemberData(nameof(NativeErrorData))] public void ConstructorTests_NativeError_Exception_Success(int nativeError, WebSocketError webSocketError) { var inner = new Exception(); @@ -103,7 +103,7 @@ namespace System.Net.WebSockets.Tests Assert.Equal(wse.InnerException, inner); } - [Theory, MemberData("UnrelatedErrorData")] + [Theory, MemberData(nameof(UnrelatedErrorData))] public void ConstructorTests_WebSocketError_NativeError_Success(int nativeError, WebSocketError error) { var wse = new WebSocketException(error, nativeError); @@ -113,7 +113,7 @@ namespace System.Net.WebSockets.Tests Assert.Null(wse.InnerException); } - [Theory, MemberData("UnrelatedErrorData")] + [Theory, MemberData(nameof(UnrelatedErrorData))] public void ConstructorTests_WebSocketError_NativeError_Message_Success(int nativeError, WebSocketError error) { const string Message = "Message"; @@ -124,7 +124,7 @@ namespace System.Net.WebSockets.Tests Assert.Null(wse.InnerException); } - [Theory, MemberData("UnrelatedErrorData")] + [Theory, MemberData(nameof(UnrelatedErrorData))] public void ConstructorTests_WebSocketError_NativeError_Exception_Success(int nativeError, WebSocketError error) { var inner = new Exception(); @@ -135,7 +135,7 @@ namespace System.Net.WebSockets.Tests Assert.Equal(wse.InnerException, inner); } - [Theory, MemberData("UnrelatedErrorData")] + [Theory, MemberData(nameof(UnrelatedErrorData))] public void ConstructorTests_WebSocketError_NativeError_Message_Exception_Success(int nativeError, WebSocketError error) { const string Message = "Message"; diff --git a/src/System.Net.WebSockets/tests/WebSocketReceiveResultTests.cs b/src/System.Net.WebSockets/tests/WebSocketReceiveResultTests.cs index 11c117fa44..fc2692cc4c 100644 --- a/src/System.Net.WebSockets/tests/WebSocketReceiveResultTests.cs +++ b/src/System.Net.WebSockets/tests/WebSocketReceiveResultTests.cs @@ -17,7 +17,7 @@ namespace System.Net.WebSockets.Tests new object[] { 5, WebSocketMessageType.Close, true, WebSocketCloseStatus.NormalClosure, "normal" }, }; - [Theory, MemberData("ConstructorData")] + [Theory, MemberData(nameof(ConstructorData))] public void ConstructorTest_Success(int count, WebSocketMessageType messageType, bool endOfMessage, WebSocketCloseStatus? closeStatus, string closeStatusDescription) { var wsrr = new WebSocketReceiveResult(count, messageType, endOfMessage, closeStatus, closeStatusDescription); diff --git a/src/System.Numerics.Vectors/tests/Performance/Perf.Vector2.cs b/src/System.Numerics.Vectors/tests/Performance/Perf.Vector2.cs index 774a9a20ec..5705cc2af4 100644 --- a/src/System.Numerics.Vectors/tests/Performance/Perf.Vector2.cs +++ b/src/System.Numerics.Vectors/tests/Performance/Perf.Vector2.cs @@ -18,7 +18,7 @@ namespace System.Numerics.Tests } [Benchmark] - [MemberData("TestOperations")] + [MemberData(nameof(TestOperations))] public void Operation(Operations operation) { Random rand = new Random(84329); diff --git a/src/System.Numerics.Vectors/tests/Performance/Perf.Vector3.cs b/src/System.Numerics.Vectors/tests/Performance/Perf.Vector3.cs index 3353ae4814..0460c98ac3 100644 --- a/src/System.Numerics.Vectors/tests/Performance/Perf.Vector3.cs +++ b/src/System.Numerics.Vectors/tests/Performance/Perf.Vector3.cs @@ -18,7 +18,7 @@ namespace System.Numerics.Tests } [Benchmark] - [MemberData("TestOperations")] + [MemberData(nameof(TestOperations))] public void Operation(Operations operation) { Random rand = new Random(84329); diff --git a/src/System.Numerics.Vectors/tests/Performance/Perf.Vector4.cs b/src/System.Numerics.Vectors/tests/Performance/Perf.Vector4.cs index 4dbd632b16..9941b29d78 100644 --- a/src/System.Numerics.Vectors/tests/Performance/Perf.Vector4.cs +++ b/src/System.Numerics.Vectors/tests/Performance/Perf.Vector4.cs @@ -18,7 +18,7 @@ namespace System.Numerics.Tests } [Benchmark] - [MemberData("TestOperations")] + [MemberData(nameof(TestOperations))] public void Operation(Operations operation) { Random rand = new Random(84329); diff --git a/src/System.ObjectModel/tests/KeyedCollection/TestMethods.cs b/src/System.ObjectModel/tests/KeyedCollection/TestMethods.cs index 48a22189db..b0db1ab235 100644 --- a/src/System.ObjectModel/tests/KeyedCollection/TestMethods.cs +++ b/src/System.ObjectModel/tests/KeyedCollection/TestMethods.cs @@ -293,7 +293,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void AddNullKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -334,7 +334,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void AddExistingKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -375,7 +375,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void AddUniqueKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -415,7 +415,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void NonGenericAddNullKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -454,7 +454,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void NonGenericAddExistingKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -492,7 +492,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void NonGenericAddUniqueKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -529,7 +529,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void ChangeItemKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -575,7 +575,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void ChangeItemKeyThrowsPreexistingKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -618,7 +618,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void ChangeItemKeySameKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -661,7 +661,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void ChangeItemDoesNotExistThrows( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -711,7 +711,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void ChangeItemKeyNullToNull( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -757,7 +757,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void ChangeItemKeyNullToNonNull( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -806,7 +806,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void ChangeItemKeyNonNullToNull( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -854,7 +854,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("CollectionSizes")] + [MemberData(nameof(CollectionSizes))] public void ChangeItemKeyNullItemNotPresent(int collectionSize) { if (default(TKey) == null) @@ -887,7 +887,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("CollectionSizes")] + [MemberData(nameof(CollectionSizes))] public void ChangeItemKeyNullItemPresent(int collectionSize) { if (default(TKey) == null) @@ -919,7 +919,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("CollectionSizes")] + [MemberData(nameof(CollectionSizes))] public void ChangeItemKeyNullKeyNotPresent(int collectionSize) { if (default(TKey) == null) @@ -947,7 +947,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("CollectionSizes")] + [MemberData(nameof(CollectionSizes))] public void ChangeItemKeyNullKeyPresent(int collectionSize) { if (default(TKey) == null) @@ -976,7 +976,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("CollectionSizes")] + [MemberData(nameof(CollectionSizes))] public void ChangeItemKeyNullItemNullKeyPresent( int collectionSize) { @@ -1008,7 +1008,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData2")] + [MemberData(nameof(ClassData2))] public void ChangeItemKeyKeyAlreadyChanged( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1056,7 +1056,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData2")] + [MemberData(nameof(ClassData2))] public void ChangeItemKeyKeyAlreadyChangedNewKeyIsOldKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1104,7 +1104,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData2")] + [MemberData(nameof(ClassData2))] public void ChangeItemKeyKeyAlreadyChangedNewKeyIsDifferent( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1154,7 +1154,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData2")] + [MemberData(nameof(ClassData2))] public void ChangeItemKeyNullToNewKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1216,7 +1216,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData2")] + [MemberData(nameof(ClassData2))] public void ChangeItemKeyNullToOldKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1282,7 +1282,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData2")] + [MemberData(nameof(ClassData2))] public void ChangeItemKeyNullToOtherKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1346,7 +1346,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData2")] + [MemberData(nameof(ClassData2))] public void ChangeItemKeySetKeyNonNullToNull( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1391,7 +1391,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData2")] + [MemberData(nameof(ClassData2))] public void ChangeItemKeySetKeyNonNullToNullChangeKeyNonNull( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1445,7 +1445,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData2")] + [MemberData(nameof(ClassData2))] public void ChangeItemKeySetKeyNonNullToNullChangeKeySomethingElse( int collectionSize, @@ -1532,7 +1532,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void Contains( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1588,7 +1588,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ThresholdData")] + [MemberData(nameof(ThresholdData))] public void Threshold( int collectionDictionaryThreshold, Named<AddItemsFunc<TKey, IKeyedItem<TKey, TValue>>> addItems) @@ -1666,7 +1666,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ContainsKeyData")] + [MemberData(nameof(ContainsKeyData))] public void ContainsKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1713,7 +1713,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ContainsKeyData")] + [MemberData(nameof(ContainsKeyData))] public void RemoveKey( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1781,7 +1781,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ContainsKeyData")] + [MemberData(nameof(ContainsKeyData))] public void KeyIndexer( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> @@ -1829,7 +1829,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("CollectionSizes")] + [MemberData(nameof(CollectionSizes))] public void KeyIndexerSet(int collectionSize) { TKey[] keys; @@ -1851,7 +1851,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("DictionaryData")] + [MemberData(nameof(DictionaryData))] public void Dictionary( int addCount, int insertCount, @@ -1928,7 +1928,7 @@ namespace System.Collections.ObjectModel.Tests } [Theory] - [MemberData("ClassData")] + [MemberData(nameof(ClassData))] public void Insert( int collectionSize, Named<KeyedCollectionGetKeyedValue<TKey, TValue>> diff --git a/src/System.ObjectModel/tests/ObservableCollection/ObservableCollection_ConstructorAndPropertyTests.cs b/src/System.ObjectModel/tests/ObservableCollection/ObservableCollection_ConstructorAndPropertyTests.cs index 670152c4ee..dc966ab4e8 100644 --- a/src/System.ObjectModel/tests/ObservableCollection/ObservableCollection_ConstructorAndPropertyTests.cs +++ b/src/System.ObjectModel/tests/ObservableCollection/ObservableCollection_ConstructorAndPropertyTests.cs @@ -29,7 +29,7 @@ namespace System.Collections.ObjectModel.Tests /// Tests that the IEnumerable constructor can various IEnumerables with items. /// </summary> [Theory] - [MemberData("Collections")] + [MemberData(nameof(Collections))] public static void IEnumerableConstructorTest(IEnumerable<string> collection) { var actual = new ObservableCollection<string>(collection); diff --git a/src/System.Reflection.TypeExtensions/tests/CoreCLR/MemberInfo/MetadataToken.CoreCLR.cs b/src/System.Reflection.TypeExtensions/tests/CoreCLR/MemberInfo/MetadataToken.CoreCLR.cs index f3065ed5f8..7b7b222c42 100644 --- a/src/System.Reflection.TypeExtensions/tests/CoreCLR/MemberInfo/MetadataToken.CoreCLR.cs +++ b/src/System.Reflection.TypeExtensions/tests/CoreCLR/MemberInfo/MetadataToken.CoreCLR.cs @@ -35,7 +35,7 @@ namespace System.Reflection.TypeExtensions.Tests } [Theory] - [MemberData("MembersWithExpectedTableIndex")] + [MemberData(nameof(MembersWithExpectedTableIndex))] public void SuccessImpliesNonNilWithCorrectTable(MemberInfo member, int expectedTableIndex) { diff --git a/src/System.Resources.ResourceManager/tests/ResourceManagerTests.cs b/src/System.Resources.ResourceManager/tests/ResourceManagerTests.cs index 99bbbde32e..aba43af5d0 100644 --- a/src/System.Resources.ResourceManager/tests/ResourceManagerTests.cs +++ b/src/System.Resources.ResourceManager/tests/ResourceManagerTests.cs @@ -21,7 +21,7 @@ namespace System.Resources.Tests } [Theory] - [MemberData("EnglishResourceData")] + [MemberData(nameof(EnglishResourceData))] public static void GetString_Basic(string key, string expectedValue) { ResourceManager resourceManager = new ResourceManager("System.Resources.Tests.Resources.TestResx", typeof(ResourceManagerTests).GetTypeInfo().Assembly); @@ -30,7 +30,7 @@ namespace System.Resources.Tests } [Theory] - [MemberData("EnglishResourceData")] + [MemberData(nameof(EnglishResourceData))] public static void GetString_FromResourceType(string key, string expectedValue) { Type resourceType = typeof(Resources.TestResx); diff --git a/src/System.Runtime/tests/Performance/Perf.String.cs b/src/System.Runtime/tests/Performance/Perf.String.cs index a17e422cc8..d73b8a08ee 100644 --- a/src/System.Runtime/tests/Performance/Perf.String.cs +++ b/src/System.Runtime/tests/Performance/Perf.String.cs @@ -19,7 +19,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void GetChars(int size) { PerfUtils utils = new PerfUtils(); @@ -35,7 +35,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Concat_str_str(int size) { PerfUtils utils = new PerfUtils(); @@ -48,7 +48,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Concat_str_str_str(int size) { PerfUtils utils = new PerfUtils(); @@ -62,7 +62,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Concat_str_str_str_str(int size) { PerfUtils utils = new PerfUtils(); @@ -77,7 +77,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Contains(int size) { PerfUtils utils = new PerfUtils(); @@ -90,7 +90,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Equals(int size) { PerfUtils utils = new PerfUtils(); @@ -130,7 +130,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void GetLength(int size) { PerfUtils utils = new PerfUtils(); @@ -147,7 +147,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void op_Equality(int size) { PerfUtils utils = new PerfUtils(); @@ -165,7 +165,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Replace(int size) { PerfUtils utils = new PerfUtils(); @@ -178,7 +178,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Split(int size) { PerfUtils utils = new PerfUtils(); @@ -191,7 +191,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void StartsWith(int size) { PerfUtils utils = new PerfUtils(); @@ -204,7 +204,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Substring_int(int size) { PerfUtils utils = new PerfUtils(); @@ -217,7 +217,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Substring_int_int(int size) { PerfUtils utils = new PerfUtils(); @@ -231,7 +231,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void ToLower(int size) { PerfUtils utils = new PerfUtils(); @@ -243,7 +243,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void ToUpper(int size) { PerfUtils utils = new PerfUtils(); @@ -255,7 +255,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Trim_WithWhitespace(int size) { PerfUtils utils = new PerfUtils(); @@ -267,7 +267,7 @@ namespace System.Runtime.Tests } [Benchmark] - [MemberData("TestStringSizes")] + [MemberData(nameof(TestStringSizes))] public void Trim_NothingToDo(int size) { PerfUtils utils = new PerfUtils(); diff --git a/src/System.Runtime/tests/System/Array.cs b/src/System.Runtime/tests/System/Array.cs index 2a3ad9bd4f..22c115d2d5 100644 --- a/src/System.Runtime/tests/System/Array.cs +++ b/src/System.Runtime/tests/System/Array.cs @@ -248,7 +248,7 @@ public static unsafe class ArrayTests } } - [Theory, MemberData("BinarySearchTestData")] + [Theory, MemberData(nameof(BinarySearchTestData))] public static void TestBinarySearch<T>(T[] array, T value, IComparer comparer, IComparer<T> genericComparer, Func<int, bool> verifier) { int idx = Array.BinarySearch((Array)array, value, comparer); @@ -290,7 +290,7 @@ public static unsafe class ArrayTests } } - [Theory, MemberData("BinarySearchTestDataInRange")] + [Theory, MemberData(nameof(BinarySearchTestDataInRange))] public static void TestBinarySearchInRange<T>(T[] array, int index, int length, T value, IComparer comparer, IComparer<T> genericComparer, Func<int, bool> verifier) { int idx = Array.BinarySearch((Array)array, index, length, value, comparer); diff --git a/src/System.Runtime/tests/System/Buffer.cs b/src/System.Runtime/tests/System/Buffer.cs index 6f96aaf1bd..47580ea3d6 100644 --- a/src/System.Runtime/tests/System/Buffer.cs +++ b/src/System.Runtime/tests/System/Buffer.cs @@ -67,7 +67,7 @@ public static unsafe class BufferTests } } - [Theory, MemberData("ByteLengthTestData")] + [Theory, MemberData(nameof(ByteLengthTestData))] public static void TestByteLength(Type type, int size) { const int length = 25; diff --git a/src/System.Runtime/tests/System/Byte.cs b/src/System.Runtime/tests/System/Byte.cs index 64ae34539b..086e65bab5 100644 --- a/src/System.Runtime/tests/System/Byte.cs +++ b/src/System.Runtime/tests/System/Byte.cs @@ -211,7 +211,7 @@ public static class ByteTests yield return new object[] { "(123)", NumberStyles.AllowParentheses, defaultFormat, typeof(OverflowException) }; // Parentheses = negative } - [Theory, MemberData("ParseValidData")] + [Theory, MemberData(nameof(ParseValidData))] public static void TestParse(string value, NumberStyles style, NumberFormatInfo nfi, byte expected) { byte i; @@ -242,7 +242,7 @@ public static class ByteTests Assert.Equal(expected, byte.Parse(value, style, nfi ?? new NumberFormatInfo())); } - [Theory, MemberData("ParseInvalidData")] + [Theory, MemberData(nameof(ParseInvalidData))] public static void TestParseInvalid(string value, NumberStyles style, NumberFormatInfo nfi, Type exceptionType) { byte i; diff --git a/src/System.Runtime/tests/System/Decimal.cs b/src/System.Runtime/tests/System/Decimal.cs index c25e2b8589..1771f18d73 100644 --- a/src/System.Runtime/tests/System/Decimal.cs +++ b/src/System.Runtime/tests/System/Decimal.cs @@ -777,7 +777,7 @@ public static class DecimalTests } } - [Theory, MemberData("DecimalTestData")] + [Theory, MemberData(nameof(DecimalTestData))] public static void TestGetBits(decimal input, int[] expectedBits) { int[] actualsBits = decimal.GetBits(input); diff --git a/src/System.Runtime/tests/System/Int16.cs b/src/System.Runtime/tests/System/Int16.cs index f1a1addf29..4e385d1048 100644 --- a/src/System.Runtime/tests/System/Int16.cs +++ b/src/System.Runtime/tests/System/Int16.cs @@ -228,7 +228,7 @@ public static class Int16Tests yield return new object[] { "32768", defaultStyle, defaultFormat, typeof(OverflowException) }; // > max value } - [Theory, MemberData("ParseValidData")] + [Theory, MemberData(nameof(ParseValidData))] public static void TestParse(string value, NumberStyles style, NumberFormatInfo nfi, short expected) { short i; @@ -259,7 +259,7 @@ public static class Int16Tests Assert.Equal(expected, short.Parse(value, style, nfi ?? new NumberFormatInfo())); } - [Theory, MemberData("ParseInvalidData")] + [Theory, MemberData(nameof(ParseInvalidData))] public static void TestParseInvalid(string value, NumberStyles style, NumberFormatInfo nfi, Type exceptionType) { short i; diff --git a/src/System.Runtime/tests/System/Int32.cs b/src/System.Runtime/tests/System/Int32.cs index 68b23a8596..f003fd1cf3 100644 --- a/src/System.Runtime/tests/System/Int32.cs +++ b/src/System.Runtime/tests/System/Int32.cs @@ -227,7 +227,7 @@ public static class Int32Tests yield return new object[] { "2147483648", defaultStyle, defaultFormat, typeof(OverflowException) }; // < min value } - [Theory, MemberData("ParseValidData")] + [Theory, MemberData(nameof(ParseValidData))] public static void TestParse(string value, NumberStyles style, NumberFormatInfo nfi, int expected) { int i; @@ -258,7 +258,7 @@ public static class Int32Tests Assert.Equal(expected, int.Parse(value, style, nfi ?? new NumberFormatInfo())); } - [Theory, MemberData("ParseInvalidData")] + [Theory, MemberData(nameof(ParseInvalidData))] public static void TestParseInvalid(string value, NumberStyles style, NumberFormatInfo nfi, Type exceptionType) { int i; diff --git a/src/System.Runtime/tests/System/Int64.cs b/src/System.Runtime/tests/System/Int64.cs index b4c28d6a4d..9ceafe51c0 100644 --- a/src/System.Runtime/tests/System/Int64.cs +++ b/src/System.Runtime/tests/System/Int64.cs @@ -234,7 +234,7 @@ public static class Int64Tests yield return new object[] { "9223372036854775808", defaultStyle, defaultFormat, typeof(OverflowException) }; // > max value } - [Theory, MemberData("ParseValidData")] + [Theory, MemberData(nameof(ParseValidData))] public static void TestParse(string value, NumberStyles style, NumberFormatInfo nfi, long expected) { long i; @@ -265,7 +265,7 @@ public static class Int64Tests Assert.Equal(expected, long.Parse(value, style, nfi ?? new NumberFormatInfo())); } - [Theory, MemberData("ParseInvalidData")] + [Theory, MemberData(nameof(ParseInvalidData))] public static void TestParseInvalid(string value, NumberStyles style, NumberFormatInfo nfi, Type exceptionType) { long i; diff --git a/src/System.Runtime/tests/System/SByte.cs b/src/System.Runtime/tests/System/SByte.cs index 81010fcd09..07722b7dbf 100644 --- a/src/System.Runtime/tests/System/SByte.cs +++ b/src/System.Runtime/tests/System/SByte.cs @@ -212,7 +212,7 @@ public static class SByteTests yield return new object[] { "128", defaultStyle, defaultFormat, typeof(OverflowException) }; // > max value } - [Theory, MemberData("ParseValidData")] + [Theory, MemberData(nameof(ParseValidData))] public static void TestParse(string value, NumberStyles style, NumberFormatInfo nfi, sbyte expected) { sbyte i; @@ -243,7 +243,7 @@ public static class SByteTests Assert.Equal(expected, sbyte.Parse(value, style, nfi ?? new NumberFormatInfo())); } - [Theory, MemberData("ParseInvalidData")] + [Theory, MemberData(nameof(ParseInvalidData))] public static void TestParseInvalid(string value, NumberStyles style, NumberFormatInfo nfi, Type exceptionType) { sbyte i; diff --git a/src/System.Runtime/tests/System/TimeSpan.cs b/src/System.Runtime/tests/System/TimeSpan.cs index 5a70f0fb2a..665b8a4954 100644 --- a/src/System.Runtime/tests/System/TimeSpan.cs +++ b/src/System.Runtime/tests/System/TimeSpan.cs @@ -65,7 +65,7 @@ public static unsafe class TimeSpanTests Assert.Equal(new TimeSpan(0, 0, 0, 0, ts.Milliseconds), spanRes); } - [Theory, MemberData("TimeSpanTestData")] + [Theory, MemberData(nameof(TimeSpanTestData))] public static void ParseExactTest(string inputTimeSpan, string format, TimeSpan expectedTimeSpan) { TimeSpan actualTimeSpan = TimeSpan.ParseExact(inputTimeSpan, format, new CultureInfo("en-US")); @@ -87,7 +87,7 @@ public static unsafe class TimeSpanTests } } - [Theory, MemberData("TimeSpanTestData_IncorrectFormat")] + [Theory, MemberData(nameof(TimeSpanTestData_IncorrectFormat))] public static void ParseExactTest_Exception(string inputTimeSpan, string format, Type expectedException) { Assert.Throws(expectedException, () => TimeSpan.ParseExact(inputTimeSpan, format, new CultureInfo("en-US"))); diff --git a/src/System.Runtime/tests/System/UInt16.cs b/src/System.Runtime/tests/System/UInt16.cs index 2ef3371600..9ecdd73658 100644 --- a/src/System.Runtime/tests/System/UInt16.cs +++ b/src/System.Runtime/tests/System/UInt16.cs @@ -210,7 +210,7 @@ public static class UInt16Tests yield return new object[] { "(123)", NumberStyles.AllowParentheses, defaultFormat, typeof(OverflowException) }; // Parentheses = negative } - [Theory, MemberData("ParseValidData")] + [Theory, MemberData(nameof(ParseValidData))] public static void TestParse(string value, NumberStyles style, NumberFormatInfo nfi, ushort expected) { ushort i; @@ -241,7 +241,7 @@ public static class UInt16Tests Assert.Equal(expected, ushort.Parse(value, style, nfi ?? new NumberFormatInfo())); } - [Theory, MemberData("ParseInvalidData")] + [Theory, MemberData(nameof(ParseInvalidData))] public static void TestParseInvalid(string value, NumberStyles style, NumberFormatInfo nfi, Type exceptionType) { ushort i; diff --git a/src/System.Runtime/tests/System/UInt32.cs b/src/System.Runtime/tests/System/UInt32.cs index 307a7234be..48c957ebc4 100644 --- a/src/System.Runtime/tests/System/UInt32.cs +++ b/src/System.Runtime/tests/System/UInt32.cs @@ -210,7 +210,7 @@ public static class UInt32Tests yield return new object[] { "(123)", NumberStyles.AllowParentheses, defaultFormat, typeof(OverflowException) }; // Parentheses = negative } - [Theory, MemberData("ParseValidData")] + [Theory, MemberData(nameof(ParseValidData))] public static void TestParse(string value, NumberStyles style, NumberFormatInfo nfi, uint expected) { uint i; @@ -241,7 +241,7 @@ public static class UInt32Tests Assert.Equal(expected, uint.Parse(value, style, nfi ?? new NumberFormatInfo())); } - [Theory, MemberData("ParseInvalidData")] + [Theory, MemberData(nameof(ParseInvalidData))] public static void TestParseInvalid(string value, NumberStyles style, NumberFormatInfo nfi, Type exceptionType) { uint i; diff --git a/src/System.Runtime/tests/System/UInt64.cs b/src/System.Runtime/tests/System/UInt64.cs index 788be90423..acbbec2445 100644 --- a/src/System.Runtime/tests/System/UInt64.cs +++ b/src/System.Runtime/tests/System/UInt64.cs @@ -211,7 +211,7 @@ public static class UInt64Tests yield return new object[] { "(123)", NumberStyles.AllowParentheses, defaultFormat, typeof(OverflowException) }; // Parentheses = negative } - [Theory, MemberData("ParseValidData")] + [Theory, MemberData(nameof(ParseValidData))] public static void TestParse(string value, NumberStyles style, NumberFormatInfo nfi, ulong expected) { ulong i; @@ -242,7 +242,7 @@ public static class UInt64Tests Assert.Equal(expected, ulong.Parse(value, style, nfi ?? new NumberFormatInfo())); } - [Theory, MemberData("ParseInvalidData")] + [Theory, MemberData(nameof(ParseInvalidData))] public static void TestParseInvalid(string value, NumberStyles style, NumberFormatInfo nfi, Type exceptionType) { ulong i; diff --git a/src/System.Security.Cryptography.Algorithms/tests/IncrementalHashTests.cs b/src/System.Security.Cryptography.Algorithms/tests/IncrementalHashTests.cs index 8b02cfefe1..e9926220e3 100644 --- a/src/System.Security.Cryptography.Algorithms/tests/IncrementalHashTests.cs +++ b/src/System.Security.Cryptography.Algorithms/tests/IncrementalHashTests.cs @@ -39,7 +39,7 @@ namespace System.Security.Cryptography.Algorithms.Tests } [Theory] - [MemberData("GetHashAlgorithms")] + [MemberData(nameof(GetHashAlgorithms))] public static void VerifyIncrementalHash(HashAlgorithm referenceAlgorithm, HashAlgorithmName hashAlgorithm) { using (referenceAlgorithm) @@ -50,7 +50,7 @@ namespace System.Security.Cryptography.Algorithms.Tests } [Theory] - [MemberData("GetHMACs")] + [MemberData(nameof(GetHMACs))] public static void VerifyIncrementalHMAC(HMAC referenceAlgorithm, HashAlgorithmName hashAlgorithm) { using (referenceAlgorithm) @@ -97,7 +97,7 @@ namespace System.Security.Cryptography.Algorithms.Tests } [Theory] - [MemberData("GetHashAlgorithms")] + [MemberData(nameof(GetHashAlgorithms))] public static void VerifyEmptyHash(HashAlgorithm referenceAlgorithm, HashAlgorithmName hashAlgorithm) { using (referenceAlgorithm) @@ -116,7 +116,7 @@ namespace System.Security.Cryptography.Algorithms.Tests } [Theory] - [MemberData("GetHMACs")] + [MemberData(nameof(GetHMACs))] public static void VerifyEmptyHMAC(HMAC referenceAlgorithm, HashAlgorithmName hashAlgorithm) { using (referenceAlgorithm) @@ -137,7 +137,7 @@ namespace System.Security.Cryptography.Algorithms.Tests } [Theory] - [MemberData("GetHashAlgorithms")] + [MemberData(nameof(GetHashAlgorithms))] public static void VerifyTrivialHash(HashAlgorithm referenceAlgorithm, HashAlgorithmName hashAlgorithm) { using (referenceAlgorithm) @@ -151,7 +151,7 @@ namespace System.Security.Cryptography.Algorithms.Tests } [Theory] - [MemberData("GetHMACs")] + [MemberData(nameof(GetHMACs))] public static void VerifyTrivialHMAC(HMAC referenceAlgorithm, HashAlgorithmName hashAlgorithm) { using (referenceAlgorithm) diff --git a/src/System.Security.Cryptography.Algorithms/tests/ReusabilityTests.cs b/src/System.Security.Cryptography.Algorithms/tests/ReusabilityTests.cs index 975f86ba3d..20e23c9478 100644 --- a/src/System.Security.Cryptography.Algorithms/tests/ReusabilityTests.cs +++ b/src/System.Security.Cryptography.Algorithms/tests/ReusabilityTests.cs @@ -10,7 +10,7 @@ namespace System.Security.Cryptography.Hashing.Algorithms.Tests public class ReusabilityTests { [Theory] - [MemberData("ReusabilityHashAlgorithms")] + [MemberData(nameof(ReusabilityHashAlgorithms))] public void TestReusability(HashAlgorithm hashAlgorithm) { using (hashAlgorithm) diff --git a/src/System.Security.Cryptography.Encoding/tests/Oid.cs b/src/System.Security.Cryptography.Encoding/tests/Oid.cs index 2f04a75a26..0e89ea7223 100644 --- a/src/System.Security.Cryptography.Encoding/tests/Oid.cs +++ b/src/System.Security.Cryptography.Encoding/tests/Oid.cs @@ -18,7 +18,7 @@ namespace System.Security.Cryptography.Encoding.Tests } [Theory] - [MemberData("ValidOidFriendlyNamePairs")] + [MemberData(nameof(ValidOidFriendlyNamePairs))] public static void LookupOidByValue_Ctor(string oidValue, string friendlyName) { Oid oid = new Oid(oidValue); @@ -28,7 +28,7 @@ namespace System.Security.Cryptography.Encoding.Tests } [Theory] - [MemberData("ValidOidFriendlyNamePairs")] + [MemberData(nameof(ValidOidFriendlyNamePairs))] public static void LookupOidByFriendlyName_Ctor(string oidValue, string friendlyName) { Oid oid = new Oid(friendlyName); @@ -63,7 +63,7 @@ namespace System.Security.Cryptography.Encoding.Tests } [Theory] - [MemberData("ValidOidFriendlyNamePairs")] + [MemberData(nameof(ValidOidFriendlyNamePairs))] public static void Oid_StringString_NullFriendlyName(string oidValue, string expectedFriendlyName) { // Can omit friendly-name - FriendlyName property demand-computes it. @@ -154,7 +154,7 @@ namespace System.Security.Cryptography.Encoding.Tests } [Theory] - [MemberData("ValidOidFriendlyNameHashAlgorithmPairs")] + [MemberData(nameof(ValidOidFriendlyNameHashAlgorithmPairs))] public static void LookupOidByValue_Method_HashAlgorithm(string oidValue, string friendlyName) { Oid oid = Oid.FromOidValue(oidValue, OidGroup.HashAlgorithm); @@ -164,7 +164,7 @@ namespace System.Security.Cryptography.Encoding.Tests } [Theory] - [MemberData("ValidOidFriendlyNameEncryptionAlgorithmPairs")] + [MemberData(nameof(ValidOidFriendlyNameEncryptionAlgorithmPairs))] public static void LookupOidByValue_Method_EncryptionAlgorithm(string oidValue, string friendlyName) { Oid oid = Oid.FromOidValue(oidValue, OidGroup.EncryptionAlgorithm); @@ -174,7 +174,7 @@ namespace System.Security.Cryptography.Encoding.Tests } [Theory] - [MemberData("ValidOidFriendlyNameHashAlgorithmPairs")] + [MemberData(nameof(ValidOidFriendlyNameHashAlgorithmPairs))] [PlatformSpecific(PlatformID.Windows)] public static void LookupOidByValue_Method_WrongGroup(string oidValue, string friendlyName) { @@ -197,7 +197,7 @@ namespace System.Security.Cryptography.Encoding.Tests } [Theory] - [MemberData("ValidOidFriendlyNameHashAlgorithmPairs")] + [MemberData(nameof(ValidOidFriendlyNameHashAlgorithmPairs))] public static void LookupOidByFriendlyName_Method_HashAlgorithm(string oidValue, string friendlyName) { Oid oid = Oid.FromFriendlyName(friendlyName, OidGroup.HashAlgorithm); @@ -207,7 +207,7 @@ namespace System.Security.Cryptography.Encoding.Tests } [Theory] - [MemberData("ValidOidFriendlyNameEncryptionAlgorithmPairs")] + [MemberData(nameof(ValidOidFriendlyNameEncryptionAlgorithmPairs))] public static void LookupOidByFriendlyName_Method_EncryptionAlgorithm(string oidValue, string friendlyName) { Oid oid = Oid.FromFriendlyName(friendlyName, OidGroup.EncryptionAlgorithm); @@ -217,7 +217,7 @@ namespace System.Security.Cryptography.Encoding.Tests } [Theory] - [MemberData("ValidOidFriendlyNamePairs")] + [MemberData(nameof(ValidOidFriendlyNamePairs))] public static void LookupOidByFriendlyName_Method_InverseCase(string oidValue, string friendlyName) { // Note that oid lookup is case-insensitive, and we store the name in the form it was @@ -230,7 +230,7 @@ namespace System.Security.Cryptography.Encoding.Tests } [Theory] - [MemberData("ValidOidFriendlyNameHashAlgorithmPairs")] + [MemberData(nameof(ValidOidFriendlyNameHashAlgorithmPairs))] [PlatformSpecific(PlatformID.Windows)] public static void LookupOidByFriendlyName_Method_WrongGroup(string oidValue, string friendlyName) { diff --git a/src/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs index e579876b50..85811e2b87 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs @@ -128,7 +128,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("VerifyExpressionData")] + [MemberData(nameof(VerifyExpressionData))] public static void VerifyExpiration_LocalTime(DateTime verificationTime, bool shouldBeValid, DateTimeKind kind) { using (var microsoftDotCom = new X509Certificate2(TestData.MicrosoftDotComSslCertBytes)) diff --git a/src/System.Security.Cryptography.X509Certificates/tests/ContentTypeTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/ContentTypeTests.cs index a0faf77026..2783174790 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/ContentTypeTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/ContentTypeTests.cs @@ -21,7 +21,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("GetContentBlobsWithType")] + [MemberData(nameof(GetContentBlobsWithType))] public static void TestBlobContentType(byte[] blob, X509ContentType contentType) { X509ContentType blobType = X509Certificate2.GetCertContentType(blob); diff --git a/src/System.Security.Cryptography.X509Certificates/tests/ExtensionsTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/ExtensionsTests.cs index 13de7a63db..a701fafe2c 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/ExtensionsTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/ExtensionsTests.cs @@ -205,7 +205,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("BasicConstraintsData")] + [MemberData(nameof(BasicConstraintsData))] public static void BasicConstraintsExtensionEncode( bool certificateAuthority, bool hasPathLengthConstraint, @@ -224,7 +224,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("BasicConstraintsData")] + [MemberData(nameof(BasicConstraintsData))] public static void BasicConstraintsExtensionDecode( bool certificateAuthority, bool hasPathLengthConstraint, diff --git a/src/System.Security.Cryptography.X509Certificates/tests/FindTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/FindTests.cs index 5848caa396..10a60e77b3 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/FindTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/FindTests.cs @@ -103,7 +103,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("GenerateInvalidInputs")] + [MemberData(nameof(GenerateInvalidInputs))] public static void FindWithWrongTypeValue(X509FindType findType, Type badValueType) { object badValue; @@ -133,7 +133,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("GenerateInvalidOidInputs")] + [MemberData(nameof(GenerateInvalidOidInputs))] public static void FindWithBadOids(X509FindType findType, string badOid) { RunExceptionTest<ArgumentException>(findType, badOid); @@ -541,7 +541,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("GenerateWorkingFauxSerialNumbers")] + [MemberData(nameof(GenerateWorkingFauxSerialNumbers))] public static void TestBySerialNumber_Match_NonDecimalInput(string input) { RunSingleMatchTest_MsCer(X509FindType.FindBySerialNumber, input); diff --git a/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameEncodingTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameEncodingTests.cs index 35e1900e82..d049bc7ea7 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameEncodingTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameEncodingTests.cs @@ -31,7 +31,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("SingleRdnTestCases")] + [MemberData(nameof(SingleRdnTestCases))] public static void EncodeSingleRdn(SimpleEncoderTestCase testCase) { X500DistinguishedName dn = new X500DistinguishedName(testCase.Input, X500DistinguishedNameFlags.None); @@ -40,7 +40,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("GetFlagBasedDnCases")] + [MemberData(nameof(GetFlagBasedDnCases))] public static void EncodeWithFlags(FlagControlledEncoderTestCase testCase) { X500DistinguishedName dn = new X500DistinguishedName(testCase.Input, testCase.Flags); @@ -49,7 +49,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("SeparatorFlagCombinations")] + [MemberData(nameof(SeparatorFlagCombinations))] private static void VerifySeparatorProcessing(X500DistinguishedNameFlags flags) { const string input = "CN=a, O=b; OU=c\r L=d\n S=e"; @@ -120,7 +120,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("ParserBoundaryCases")] + [MemberData(nameof(ParserBoundaryCases))] public static void CheckParserBoundaryCases(SimpleEncoderTestCase testCase) { X500DistinguishedName dn = new X500DistinguishedName(testCase.Input, X500DistinguishedNameFlags.None); diff --git a/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameTests.cs index 73dd684d42..05b60a3eb0 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameTests.cs @@ -48,7 +48,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("WhitespaceBeforeCases")] + [MemberData(nameof(WhitespaceBeforeCases))] public static void QuoteWhitespaceBefore(string expected, string hexEncoded) { byte[] encoded = hexEncoded.HexToByteArray(); @@ -57,7 +57,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("WhitespaceBeforeCases")] + [MemberData(nameof(WhitespaceBeforeCases))] public static void NoQuoteWhitespaceBefore(string expectedQuoted, string hexEncoded) { string expected = expectedQuoted.Replace("\"", ""); @@ -68,7 +68,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("WhitespaceAfterCases")] + [MemberData(nameof(WhitespaceAfterCases))] public static void QuoteWhitespaceAfter(string expected, string hexEncoded) { byte[] encoded = hexEncoded.HexToByteArray(); @@ -77,7 +77,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("WhitespaceAfterCases")] + [MemberData(nameof(WhitespaceAfterCases))] public static void NoQuoteWhitespaceAfter(string expectedQuoted, string hexEncoded) { string expected = expectedQuoted.Replace("\"", ""); @@ -88,7 +88,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("QuotedContentsCases")] + [MemberData(nameof(QuotedContentsCases))] public static void QuoteByContents(string expected, string hexEncoded) { byte[] encoded = hexEncoded.HexToByteArray(); @@ -97,7 +97,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("QuotedContentsCases")] + [MemberData(nameof(QuotedContentsCases))] public static void NoQuoteByContents(string expectedQuoted, string hexEncoded) { string expected = expectedQuoted.Replace("\"", ""); @@ -108,7 +108,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("InternallyQuotedRDNs")] + [MemberData(nameof(InternallyQuotedRDNs))] public static void QuotedWithQuotes(string quoted, string notQuoted, string hexEncoded) { byte[] encoded = hexEncoded.HexToByteArray(); @@ -118,7 +118,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests } [Theory] - [MemberData("InternallyQuotedRDNs")] + [MemberData(nameof(InternallyQuotedRDNs))] public static void NotQuotedWithQuotes(string quoted, string notQuoted, string hexEncoded) { byte[] encoded = hexEncoded.HexToByteArray(); diff --git a/src/System.Text.Encoding.CodePages/tests/EncodingCodePages.cs b/src/System.Text.Encoding.CodePages/tests/EncodingCodePages.cs index 0abdbcfd32..3cba69fee3 100644 --- a/src/System.Text.Encoding.CodePages/tests/EncodingCodePages.cs +++ b/src/System.Text.Encoding.CodePages/tests/EncodingCodePages.cs @@ -511,7 +511,7 @@ namespace System.Text.Tests } [Theory] - [MemberData("SpecificCodepageEncodings")] + [MemberData(nameof(SpecificCodepageEncodings))] public static void TestRoundtrippingSpecificCodepageEncoding(string encodingName, byte[] bytes, string expected) { Encoding encoding = CodePagesEncodingProvider.Instance.GetEncoding(encodingName); @@ -522,7 +522,7 @@ namespace System.Text.Tests } [Theory] - [MemberData("CodePageInfo")] + [MemberData(nameof(CodePageInfo))] public static void TestCodepageEncoding(int codePage, string webName, string queryString) { Encoding encoding = CodePagesEncodingProvider.Instance.GetEncoding(queryString); @@ -541,7 +541,7 @@ namespace System.Text.Tests } [Theory] - [MemberData("MultibyteCharacterEncodings")] + [MemberData(nameof(MultibyteCharacterEncodings))] public static void TestSpecificMultibyteCharacterEncodings(string codepageName, byte[] bytes, int[] expected) { Decoder decoder = CodePagesEncodingProvider.Instance.GetEncoding(codepageName).GetDecoder(); @@ -556,7 +556,7 @@ namespace System.Text.Tests } [Theory] - [MemberData("CodePageInfo")] + [MemberData(nameof(CodePageInfo))] public static void TestEncodingDisplayNames(int codePage, string webName, string queryString) { var encoding = CodePagesEncodingProvider.Instance.GetEncoding(codePage); diff --git a/src/System.Text.Encoding/tests/Performance/Perf.Encoding.cs b/src/System.Text.Encoding/tests/Performance/Perf.Encoding.cs index a7e077d457..d83314d179 100644 --- a/src/System.Text.Encoding/tests/Performance/Perf.Encoding.cs +++ b/src/System.Text.Encoding/tests/Performance/Perf.Encoding.cs @@ -21,7 +21,7 @@ namespace System.Text.Tests } [Benchmark] - [MemberData("EncodingSizeData")] + [MemberData(nameof(EncodingSizeData))] public void GetBytes(int size, string encName) { const int innerIterations = 100; @@ -39,7 +39,7 @@ namespace System.Text.Tests } [Benchmark] - [MemberData("EncodingSizeData")] + [MemberData(nameof(EncodingSizeData))] public void GetString(int size, string encName) { const int innerIterations = 100; @@ -57,7 +57,7 @@ namespace System.Text.Tests } [Benchmark] - [MemberData("EncodingSizeData")] + [MemberData(nameof(EncodingSizeData))] public void GetChars(int size, string encName) { const int innerIterations = 100; @@ -75,7 +75,7 @@ namespace System.Text.Tests } [Benchmark] - [MemberData("EncodingSizeData")] + [MemberData(nameof(EncodingSizeData))] public void GetEncoder(int size, string encName) { const int innerIterations = 10000; @@ -91,7 +91,7 @@ namespace System.Text.Tests } [Benchmark] - [MemberData("EncodingSizeData")] + [MemberData(nameof(EncodingSizeData))] public void GetByteCount(int size, string encName) { const int innerIterations = 100; diff --git a/src/System.Threading.Tasks/tests/CESchedulerPairTests.cs b/src/System.Threading.Tasks/tests/CESchedulerPairTests.cs index 085c523eae..d1601d9827 100644 --- a/src/System.Threading.Tasks/tests/CESchedulerPairTests.cs +++ b/src/System.Threading.Tasks/tests/CESchedulerPairTests.cs @@ -336,7 +336,7 @@ namespace System.Threading.Tasks.Tests } [Theory] - [MemberData("ApiType")] + [MemberData(nameof(ApiType))] public static void TestIntegration(String apiType, bool useReader) { Debug.WriteLine(string.Format(" Running apiType:{0} useReader:{1}", apiType, useReader)); diff --git a/src/System.Threading.Tasks/tests/UnwrapTests.cs b/src/System.Threading.Tasks/tests/UnwrapTests.cs index 4ef2d7d434..2ea810635e 100644 --- a/src/System.Threading.Tasks/tests/UnwrapTests.cs +++ b/src/System.Threading.Tasks/tests/UnwrapTests.cs @@ -24,7 +24,7 @@ namespace System.Threading.Tasks.Tests /// </summary> /// <param name="inner">Will be run with a RanToCompletion, Faulted, and Canceled task.</param> [Theory] - [MemberData("CompletedNonGenericTasks")] + [MemberData(nameof(CompletedNonGenericTasks))] public void NonGeneric_Completed_Completed(Task inner) { Task<Task> outer = Task.FromResult(inner); @@ -39,7 +39,7 @@ namespace System.Threading.Tasks.Tests /// </summary> /// <param name="inner">The inner task.</param> [Theory] - [MemberData("CompletedStringTasks")] + [MemberData(nameof(CompletedStringTasks))] public void Generic_Completed_Completed(Task<string> inner) { Task<Task<string>> outer = Task.FromResult(inner); @@ -54,7 +54,7 @@ namespace System.Threading.Tasks.Tests /// </summary> /// <param name="inner">The inner task.</param> [Theory] - [MemberData("CompletedNonGenericTasks")] + [MemberData(nameof(CompletedNonGenericTasks))] public void NonGeneric_NotCompleted_Completed(Task inner) { var outerTcs = new TaskCompletionSource<Task>(); @@ -72,7 +72,7 @@ namespace System.Threading.Tasks.Tests /// </summary> /// <param name="inner">The inner task.</param> [Theory] - [MemberData("CompletedStringTasks")] + [MemberData(nameof(CompletedStringTasks))] public void Generic_NotCompleted_Completed(Task<string> inner) { var outerTcs = new TaskCompletionSource<Task<string>>(); diff --git a/src/System.Xml.XDocument/tests/Properties/DocOrderComparer.cs b/src/System.Xml.XDocument/tests/Properties/DocOrderComparer.cs index d59d9be17b..3917b8b3a0 100644 --- a/src/System.Xml.XDocument/tests/Properties/DocOrderComparer.cs +++ b/src/System.Xml.XDocument/tests/Properties/DocOrderComparer.cs @@ -141,7 +141,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetNotXNodes")] + [MemberData(nameof(GetNotXNodes))] public void NotXNode(object x, object y) { Assert.Throws<ArgumentException>(() => ((IComparer)XNode.DocumentOrderComparer).Compare(x, y)); diff --git a/src/System.Xml.XDocument/tests/events/EventsAdd.cs b/src/System.Xml.XDocument/tests/events/EventsAdd.cs index 05f1248a9c..5f98fc9b69 100644 --- a/src/System.Xml.XDocument/tests/events/EventsAdd.cs +++ b/src/System.Xml.XDocument/tests/events/EventsAdd.cs @@ -20,7 +20,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XNode[] { new XComment("Comment") }, new XDocumentType("root", "", "", "") }, new object[] { new XNode[] { new XText(""), new XText(" "), new XText("\t") }, new XText(" ") } }; - [Theory, MemberData("ExecuteXDocumentVariationParams")] + [Theory, MemberData(nameof(ExecuteXDocumentVariationParams))] public void ExecuteXDocumentVariation(XNode[] toAdd, XNode contextNode) { IEnumerable<XNode> toAddList = toAdd.OfType<XNode>(); @@ -53,7 +53,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XNode[] { new XText(""), new XText(" "), new XText("\t") }, new XText(" ") }, new object[] { InputSpace.GetElement(100, 10).DescendantNodes().ToArray(), new XText("..") } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XNode[] toAdd, XNode contextNode) { IEnumerable<XNode> toAddList = toAdd.OfType<XNode>(); @@ -138,7 +138,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object [] { new XNode[] { new XComment("Comment") }, new XElement("root") }, new object [] { new XNode[] { new XText(""), new XText(" "), new XText("\t") }, new XText(" ") } }; - [Theory, MemberData("ExecuteXDocumentVariationParams")] + [Theory, MemberData(nameof(ExecuteXDocumentVariationParams))] public void ExecuteXDocumentVariation(XNode[] toAdd, XNode contextNode) { IEnumerable<XNode> toAddList = toAdd.OfType<XNode>(); @@ -171,7 +171,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XNode[] { new XText(""), new XText(" "), new XText("\t") }, new XText(" ") }, new object[] { InputSpace.GetElement(100, 10).DescendantNodes().ToArray(), new XText("..") } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XNode[] toAdd, XNode contextNode) { IEnumerable<XNode> toAddList = toAdd.OfType<XNode>(); @@ -262,7 +262,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object [] { new XNode[] { new XComment("Comment") }, new XElement("root") }, new object [] { new XNode[] { new XText(""), new XText(" "), new XText("\t") }, new XText(" ") } }; - [Theory, MemberData("ExecuteXDocumentVariationParams")] + [Theory, MemberData(nameof(ExecuteXDocumentVariationParams))] public void ExecuteXDocumentVariation(XNode[] toAdd, XNode contextNode) { IEnumerable<XNode> allNodes, toAddList = toAdd.OfType<XNode>(); @@ -299,7 +299,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XNode[] { new XText(""), new XText(" "), new XText("\t") }, new XText(" ") }, new object[] { InputSpace.GetElement(100, 10).DescendantNodes().ToArray(), new XText("..") } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XNode[] toAdd, XNode contextNode) { IEnumerable<XNode> allNodes, toAddList = toAdd.OfType<XNode>(); @@ -426,7 +426,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XNode[] { new XComment("Comment") }, new XElement("root") }, new object[] { new XNode[] { new XText(""), new XText(" "), new XText("\t") }, new XText(" ") } }; - [Theory, MemberData("ExecuteXDocumentVariationParams")] + [Theory, MemberData(nameof(ExecuteXDocumentVariationParams))] public void ExecuteXDocumentVariation(XNode[] toAdd, XNode contextNode) { IEnumerable<XNode> allNodes, toAddList = toAdd.OfType<XNode>(); @@ -463,7 +463,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XNode[] { new XText(""), new XText(" "), new XText("\t") }, new XText(" ") }, new object[] { InputSpace.GetElement(100, 10).DescendantNodes().ToArray(), new XText("..") } }; - [Theory, MemberData("VariationsForXElementParams")] + [Theory, MemberData(nameof(VariationsForXElementParams))] public void ExecuteXElementVariation(XNode[] toAdd, XNode contextNode) { IEnumerable<XNode> allNodes, toAddList = toAdd.OfType<XNode>(); @@ -493,7 +493,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XAttribute[] { new XAttribute("{b}xxx", "b_yyy") }, new XAttribute("a", "aa") }, new object[] { InputSpace.GetElement(100, 10).Attributes().ToArray(), new XAttribute("a", "aa") } }; - [Theory, MemberData("ExecuteXAttributeVariationParams")] + [Theory, MemberData(nameof(ExecuteXAttributeVariationParams))] public void ExecuteXAttributeVariation(XAttribute[] toAdd, XAttribute contextNode) { IEnumerable<XAttribute> allNodes, toAddList = toAdd.OfType<XAttribute>(); diff --git a/src/System.Xml.XDocument/tests/events/EventsName.cs b/src/System.Xml.XDocument/tests/events/EventsName.cs index 4de7bafdb9..e3f7052b02 100644 --- a/src/System.Xml.XDocument/tests/events/EventsName.cs +++ b/src/System.Xml.XDocument/tests/events/EventsName.cs @@ -15,7 +15,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XElement("element"), (XName)"newName" }, new object[] { new XElement("parent", new XElement("child", "child text")), (XName)"{b}newName" }, }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XElement toChange, XName newName) { XElement original = new XElement(toChange); diff --git a/src/System.Xml.XDocument/tests/events/EventsRemove.cs b/src/System.Xml.XDocument/tests/events/EventsRemove.cs index dc5df2ec10..5b2e7d5343 100644 --- a/src/System.Xml.XDocument/tests/events/EventsRemove.cs +++ b/src/System.Xml.XDocument/tests/events/EventsRemove.cs @@ -20,7 +20,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XNode[] { new XComment("Comment") }, 0 }, new object[] { new XNode[] { new XText(""), new XText(" "), new XText("\t") }, 1 } }; - [Theory, MemberData("ExecuteXDocumentVariationParams")] + [Theory, MemberData(nameof(ExecuteXDocumentVariationParams))] public void ExecuteXDocumentVariation(XNode[] content, int index) { XDocument xDoc = new XDocument(content); @@ -52,7 +52,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XNode[] { new XText(""), new XText(" "), new XText("\t") }, 2 }, new object[] { InputSpace.GetElement(100, 10).DescendantNodes().ToArray(), 50 } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XNode[] content, int index) { XElement xElem = new XElement("root", content); @@ -80,7 +80,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XAttribute[] { new XAttribute("{b}xxx", "b_yyy"), new XAttribute("{a}xxx", "a_yyy") }, 0 }, new object[] { InputSpace.GetAttributeElement(10, 1000).Elements().Attributes().ToArray(), 10 } }; - [Theory, MemberData("ExecuteXAttributeVariationParams")] + [Theory, MemberData(nameof(ExecuteXAttributeVariationParams))] public void ExecuteXAttributeVariation(XAttribute[] content, int index) { XElement xElem = new XElement("root", content); @@ -344,7 +344,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XNode[] { new XComment("Comment") } }, new object[] { new XNode[] { new XText(""), new XText(" "), new XText("\t") } } }; - [Theory, MemberData("ExecuteXDocumentVariationParams")] + [Theory, MemberData(nameof(ExecuteXDocumentVariationParams))] public void ExecuteXDocumentVariation(XNode[] content) { XDocument xDoc = new XDocument(content); @@ -371,7 +371,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XNode[] { new XText(""), new XText(" "), new XText("\t") } }, new object[] { InputSpace.GetElement(100, 10).DescendantNodes().ToArray() } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XNode[] content) { XElement xElem = new XElement("root", InputSpace.GetAttributeElement(10, 1000).Elements().Attributes(), content); @@ -486,7 +486,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { InputSpace.GetAttributeElement(10, 1000).Elements().Attributes().ToArray() }, new object[] { new XObject[] { new XAttribute("{b}xxx", "b_yyy"), new XElement("parent", new XElement("child", "child text")) } } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XObject[] content) { XElement xElem = new XElement("root", content); diff --git a/src/System.Xml.XDocument/tests/events/EventsReplace.cs b/src/System.Xml.XDocument/tests/events/EventsReplace.cs index 1f80f80824..984803e7bf 100644 --- a/src/System.Xml.XDocument/tests/events/EventsReplace.cs +++ b/src/System.Xml.XDocument/tests/events/EventsReplace.cs @@ -21,7 +21,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XComment("Comment"), new XText("\t") }, new object[] { new XText(" "), XElement.Parse(@"<a></a>") } }; - [Theory, MemberData("ExecuteXDocumentVariationParams")] + [Theory, MemberData(nameof(ExecuteXDocumentVariationParams))] public void ExecuteXDocumentVariation(XNode toReplace, XNode newValue) { XDocument xDoc = new XDocument(toReplace); @@ -48,7 +48,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XComment("Comment"), new XText("\t") }, new object[] { new XText("\t"), XElement.Parse(@"<a></a>") } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XNode toReplace, XNode newValue) { XElement xElem = new XElement("root", toReplace); @@ -78,7 +78,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XProcessingInstruction("PI", "Data") }, new object[] { new XComment("Comment") } }; - [Theory, MemberData("ExecuteXDocumentVariationParams")] + [Theory, MemberData(nameof(ExecuteXDocumentVariationParams))] public void ExecuteXDocumentVariation(XNode toReplace) { XNode newValue = new XText(" "); @@ -108,7 +108,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XComment("Comment") }, new object[] { new XText("") } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XNode toReplace) { XNode newValue = new XText("text"); @@ -187,7 +187,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XAttribute[] { new XAttribute("{b}xxx", "b_yyy"), new XAttribute("{a}xxx", "a_yyy") } }, new object[] { InputSpace.GetAttributeElement(10, 1000).Elements().Attributes().ToArray() } }; - [Theory, MemberData("ExecuteXAttributeVariationParams")] + [Theory, MemberData(nameof(ExecuteXAttributeVariationParams))] public void ExecuteXAttributeVariation(XAttribute[] content) { XElement xElem = new XElement("root", content); @@ -226,7 +226,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { InputSpace.GetAttributeElement(10, 1000).Elements().Attributes().ToArray() }, new object[] { new XObject[] { new XAttribute("{b}xxx", "b_yyy"), new XElement("parent", new XElement("child", "child text")) } } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XObject[] toReplace) { XNode newValue = new XText("text"); diff --git a/src/System.Xml.XDocument/tests/events/EventsValue.cs b/src/System.Xml.XDocument/tests/events/EventsValue.cs index 64a28f7400..172809fb2f 100644 --- a/src/System.Xml.XDocument/tests/events/EventsValue.cs +++ b/src/System.Xml.XDocument/tests/events/EventsValue.cs @@ -179,7 +179,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XElement("parent", new XElement("child", "child text")), "newValue" }, new object[] { new XElement("root", InputSpace.GetElement(100, 10).DescendantNodes()), "newValue" } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XElement toChange, String newValue) { int count = toChange.Nodes().Count(); @@ -209,7 +209,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XAttribute("xxx", "yyy"), "newValue" }, new object[] { new XAttribute("{a}xxx", "a_yyy"), "newValue" } }; - [Theory, MemberData("ExecuteXAttributeVariationParams")] + [Theory, MemberData(nameof(ExecuteXAttributeVariationParams))] public void ExecuteXAttributeVariation(XAttribute toChange, string newValue) { XElement xElem = new XElement("root", toChange); @@ -238,7 +238,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XAttribute("xxx", "yyy"), "newValue" }, new object[] { new XAttribute("{a}xxx", "a_yyy"), "newValue" } }; - [Theory, MemberData("ExecuteXAttributeVariationParams")] + [Theory, MemberData(nameof(ExecuteXAttributeVariationParams))] public void ExecuteXAttributeVariation(XAttribute toChange, object newValue) { XElement xElem = new XElement("root", toChange); @@ -269,7 +269,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XElement("parent", new XElement("child", "child text")), "newValue" }, new object[] { new XElement("root", InputSpace.GetElement(100, 10).DescendantNodes()), "newValue" } }; - [Theory, MemberData("ExecuteXElementVariationParams")] + [Theory, MemberData(nameof(ExecuteXElementVariationParams))] public void ExecuteXElementVariation(XElement toChange, object newValue) { int count = toChange.Nodes().Count(); @@ -298,7 +298,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XAttribute("xxx", "yyy"), "newValue" }, new object[] { new XAttribute("{a}xxx", "a_yyy"), "newValue" } }; - [Theory, MemberData("ExecuteXAttributeVariationParams")] + [Theory, MemberData(nameof(ExecuteXAttributeVariationParams))] public void ExecuteXAttributeVariation(XAttribute toChange, object newValue) { XElement xElem = new XElement("root", toChange); @@ -329,7 +329,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XAttribute("a", "aa"), new XElement("parent", new XElement("child", "child text")) }, new object[] { new XElement("element"), new XElement("nodes", InputSpace.GetElement(100, 10).DescendantNodes()) } }; - [Theory, MemberData("ExecuteAddVariationParams")] + [Theory, MemberData(nameof(ExecuteAddVariationParams))] public void ExecuteAddVariation(XObject content, XElement toAdd) { XElement xElem = new XElement("root", content); @@ -356,7 +356,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XElement("parent", new XElement("child", "child text")) }, new object[] { new XElement("nodes", InputSpace.GetElement(100, 10).DescendantNodes()) } }; - [Theory, MemberData("ExecuteRemoveVariationParams")] + [Theory, MemberData(nameof(ExecuteRemoveVariationParams))] public void ExecuteRemoveVariation(XElement content) { XElement xElem = new XElement("root", content); @@ -383,7 +383,7 @@ namespace CoreXml.Test.XLinq.FunctionalTests.EventsTests new object[] { new XElement("parent", new XElement("child", "child text")), "Windows 8" }, new object[] { new XElement("nodes", InputSpace.GetElement(100, 10).DescendantNodes()), "StackTrace" } }; - [Theory, MemberData("ExecuteValueVariationParams")] + [Theory, MemberData(nameof(ExecuteValueVariationParams))] public void ExecuteValueVariation(XElement content, object newValue) { int count = content.Nodes().Count(); diff --git a/src/System.Xml.XDocument/tests/misc/Annotation.cs b/src/System.Xml.XDocument/tests/misc/Annotation.cs index 59a594aa2b..f2d7a3d1de 100644 --- a/src/System.Xml.XDocument/tests/misc/Annotation.cs +++ b/src/System.Xml.XDocument/tests/misc/Annotation.cs @@ -12,7 +12,7 @@ namespace System.Xml.Linq.Tests public class Annotations { [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddStringAnnotation(XObject xo) { const string expected = "test string"; @@ -25,7 +25,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddIntAnnotation(XObject xo) { const int expected = 123456; @@ -37,7 +37,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddIntAndStringAnnotation(XObject xo) { const string expectedStr = "<!@@63784sgdh111>"; @@ -52,7 +52,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddRemoveGetAnnotation(XObject xo) { string str1 = "<!@@63784sgdh111>"; @@ -73,7 +73,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void RemoveAnnotationWithoutAdding(XObject xo) { xo.RemoveAnnotations<string>(); @@ -84,7 +84,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddIntRemoveStringGetIntAnnotation(XObject xo) { const int num = 123456; @@ -95,7 +95,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddMultipleStringAnnotations(XObject xo) { const string str1 = "<!@@63784sgdh111>"; @@ -107,7 +107,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void RemoveAnnotationTwice(XObject xo) { xo.RemoveAnnotations<object>(); @@ -116,7 +116,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddGenericAnnotation(XObject xo) { Dictionary<string, string> d = new Dictionary<string, string>(); @@ -130,7 +130,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void RemoveGenericAnnotation(XObject xo) { Dictionary<string, string> d = new Dictionary<string, string>(); @@ -140,7 +140,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddInheritedAnnotation(XObject xo) { A a = new A(); @@ -158,7 +158,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void RemoveInheritedAnnotation(XObject xo) { A a = new A(); @@ -181,7 +181,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddNull(XObject xo) { Assert.Throws<ArgumentNullException>("annotation", () => xo.AddAnnotation(null)); @@ -190,7 +190,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void RemoveNull(XObject xo) { Assert.Throws<ArgumentNullException>("type", () => xo.RemoveAnnotations(null)); @@ -198,7 +198,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void GetAllNull(XObject xo) { Assert.Throws<ArgumentNullException>("type", () => xo.Annotations(null)); @@ -206,7 +206,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void GetOneNull(XObject xo) { Assert.Throws<ArgumentNullException>("type", () => xo.Annotation(null)); @@ -214,7 +214,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddNullString(XObject xo) { Assert.Throws<ArgumentNullException>("annotation", () => xo.AddAnnotation((string)null)); @@ -223,7 +223,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddAnnotationWithSameClassNameButDifferentNamespace(XObject xo) { DifferentNamespace.A a1 = new DifferentNamespace.A(); @@ -242,7 +242,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void RemoveAnnotationWithSameClassNameButDifferentNamespace(XObject xo) { DifferentNamespace.A a1 = new DifferentNamespace.A(); @@ -262,7 +262,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void RemoveAnnotationsOfDifferentTypesAndDifferentXObjects(XObject xo) { AddAnnotation(xo); @@ -275,7 +275,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void RemoveTwiceAnnotationsOfDifferentTypesAndDifferentXObjects(XObject xo) { foreach (Type type in GetTypes()) @@ -290,7 +290,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddTwiceRemoveOnceAnnotationsOfDifferentTypesAndDifferentXObjects(XObject xo) { AddAnnotation(xo); @@ -362,7 +362,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void AddAnnotationsAndRemoveOfTypeObject(XObject xo) { AddAnnotation(xo); @@ -371,7 +371,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void EnumerateAnnotationsWithoutAdding(XObject xo) { Assert.Null(xo.Annotation(typeof(object))); @@ -382,7 +382,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void RemoveAnnotationsUsingTypeObject(XObject xo) { AddAnnotation(xo); @@ -391,7 +391,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetXObjects")] + [MemberData(nameof(GetXObjects))] public void RemoveTwiceAnnotationsWithoutAddingUsingTypeObject(XObject xo) { RemoveAnnotations<object>(xo); diff --git a/src/System.Xml.XDocument/tests/misc/RegressionTests.cs b/src/System.Xml.XDocument/tests/misc/RegressionTests.cs index b257a74b8f..b3dabcff11 100644 --- a/src/System.Xml.XDocument/tests/misc/RegressionTests.cs +++ b/src/System.Xml.XDocument/tests/misc/RegressionTests.cs @@ -189,7 +189,7 @@ namespace System.Xml.Linq.Tests } [Theory] - [MemberData("GetObjects")] + [MemberData(nameof(GetObjects))] public void CreatingXElementsFromNewDev10Types(object t, Type type) { XElement e = new XElement("e1", new XElement("e2"), "text1", new XElement("e3"), t); diff --git a/src/System.Xml.XDocument/tests/xNodeBuilder/SaveOptions_OmitDuplicateNamespace.cs b/src/System.Xml.XDocument/tests/xNodeBuilder/SaveOptions_OmitDuplicateNamespace.cs index 16b683289a..2b334d3783 100644 --- a/src/System.Xml.XDocument/tests/xNodeBuilder/SaveOptions_OmitDuplicateNamespace.cs +++ b/src/System.Xml.XDocument/tests/xNodeBuilder/SaveOptions_OmitDuplicateNamespace.cs @@ -174,7 +174,7 @@ namespace CoreXml.Test.XLinq "<A xmlns='nsp'><B xmlns=''><C xmlns='nsp'><D/></C></B></A>" } }; - [Theory, MemberData("ConFlictsNSRedefenitionParams")] + [Theory, MemberData(nameof(ConFlictsNSRedefenitionParams))] public void XDocumentConflictsNSRedefinitionSaveToStringWriterAndGetContent(string xml1, string xml2) { XDocument doc = XDocument.Parse(xml1); @@ -186,7 +186,7 @@ namespace CoreXml.Test.XLinq } } - [Theory, MemberData("ConFlictsNSRedefenitionParams")] + [Theory, MemberData(nameof(ConFlictsNSRedefenitionParams))] public void XDocumentConflictsNSRedefinitionToString(string xml1, string xml2) { XDocument doc = XDocument.Parse(xml1); @@ -194,7 +194,7 @@ namespace CoreXml.Test.XLinq ReaderDiff.Compare(xml2, doc.ToString(so)); } - [Theory, MemberData("ConFlictsNSRedefenitionParams")] + [Theory, MemberData(nameof(ConFlictsNSRedefenitionParams))] public void XElementConflictsNSRedefinitionSaveToStringWriterAndGetContent(string xml1, string xml2) { XElement el = XElement.Parse(xml1); @@ -206,7 +206,7 @@ namespace CoreXml.Test.XLinq } } - [Theory, MemberData("ConFlictsNSRedefenitionParams")] + [Theory, MemberData(nameof(ConFlictsNSRedefenitionParams))] public void XElementConflictsNSRedefinitionToString(string xml1, string xml2) { XElement el = XElement.Parse(xml1); |