From a09ad52948af961a91ad56e4375135cc5a39d5f2 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Mon, 21 Oct 2024 21:57:03 -0700 Subject: [PATCH] Change return type for MemberData tests to IEnumerable (#109090) The XUnitWrapperGenerator doesn't support TheoryData. This was previously accidentally working because TheoryData was convertible to `object[]` --- src/tests/ilverify/TestDataLoader.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/tests/ilverify/TestDataLoader.cs b/src/tests/ilverify/TestDataLoader.cs index aba75551c9bba..be91d80cde6a7 100644 --- a/src/tests/ilverify/TestDataLoader.cs +++ b/src/tests/ilverify/TestDataLoader.cs @@ -36,7 +36,7 @@ class TestDataLoader /// [FriendlyName]_ValidType_Valid /// /// - public static TheoryData GetTypesWithValidType() + public static IEnumerable GetTypesWithValidType() { var typeSelector = new Func((mparams, typeDefinitionHandle) => { @@ -54,7 +54,7 @@ public static TheoryData GetTypesWithValidType() /// [FriendlyName]_InvalidType_[ExpectedVerifierError1]@[ExpectedVerifierError2]....[ExpectedVerifierErrorN] /// /// - public static TheoryData GetTypesWithInvalidType() + public static IEnumerable GetTypesWithInvalidType() { var typeSelector = new Func((mparams, typeDefinitionHandle) => { @@ -74,9 +74,9 @@ public static TheoryData GetTypesWithInvalidType() return GetTestTypeFromDll(typeSelector); } - private static TheoryData GetTestTypeFromDll(Func typeSelector) + private static List GetTestTypeFromDll(Func typeSelector) { - var retVal = new TheoryData(); + var retVal = new List(); foreach (var testDllName in GetAllTestDlls()) { @@ -95,7 +95,7 @@ private static TheoryData GetTestTypeFromDll(Func GetTestTypeFromDll(Func - public static TheoryData GetMethodsWithValidIL() + public static IEnumerable GetMethodsWithValidIL() { var methodSelector = new Func((mparams, methodHandle) => { @@ -132,7 +132,7 @@ public static TheoryData GetMethodsWithValidIL() /// 3. part: the expected VerifierErrors as string separated by '.'. /// E.g.: SimpleAdd_Invalid_ExpectedNumericType /// - public static TheoryData GetMethodsWithInvalidIL() + public static IEnumerable GetMethodsWithInvalidIL() { var methodSelector = new Func((mparams, methodHandle) => { @@ -163,9 +163,9 @@ public static TheoryData GetMethodsWithInvalidIL() return GetTestMethodsFromDll(methodSelector); } - private static TheoryData GetTestMethodsFromDll(Func methodSelector) + private static List GetTestMethodsFromDll(Func methodSelector) { - var retVal = new TheoryData(); + var retVal = new List(); foreach (var testDllName in GetAllTestDlls()) { @@ -206,7 +206,7 @@ private static TheoryData GetTestMethodsFromDll(Func