From 3dee7bdf80d10fc812d6e3ec909a087b8b6a01dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Fri, 28 Apr 2023 15:09:58 +0200 Subject: [PATCH 1/8] Bump version to 3.0.3 --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 7d1cfc3c11..d8db9c4df3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 3.0.2 + 3.0.3 release false From ce6301c469e79385fd551f85b2c036506d4a4612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Fri, 28 Apr 2023 15:12:41 +0200 Subject: [PATCH 2/8] Update shipped APIs --- .../PublicAPI/PublicAPI.Shipped.txt | 86 +++++++++++++++++++ .../PublicAPI/PublicAPI.Unshipped.txt | 86 ------------------- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Shipped.txt b/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Shipped.txt index 2d2feb3767..8f34905b36 100644 --- a/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Shipped.txt +++ b/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Shipped.txt @@ -44,6 +44,23 @@ Microsoft.VisualStudio.TestTools.UnitTesting.DataAccessMethod.Random = 1 -> Micr Microsoft.VisualStudio.TestTools.UnitTesting.DataAccessMethod.Sequential = 0 -> Microsoft.VisualStudio.TestTools.UnitTesting.DataAccessMethod Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.Data.get -> object?[]! +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute() -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, object? arg14) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, object? arg14, object? arg15) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, object? arg14, object? arg15, object? arg16) -> void Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DisplayName.get -> string? Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DisplayName.set -> void Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.GetData(System.Reflection.MethodInfo! methodInfo) -> System.Collections.Generic.IEnumerable! @@ -241,6 +258,9 @@ static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(long expecte static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(string? expected, string? actual, bool ignoreCase) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(string? expected, string? actual, bool ignoreCase, string? message) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(string? expected, string? actual, bool ignoreCase, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(string? expected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(string? expected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(string? expected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture, string? message, params object?[]? parameters) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(T? expected, T? actual) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(T? expected, T? actual, string? message) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(T? expected, T? actual, string? message, params object?[]? parameters) -> void @@ -262,6 +282,9 @@ static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(long notE static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(string? notExpected, string? actual, bool ignoreCase) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(string? notExpected, string? actual, bool ignoreCase, string? message) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(string? notExpected, string? actual, bool ignoreCase, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture, string? message, params object?[]? parameters) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(T? notExpected, T? actual) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(T? notExpected, T? actual, string? message) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(T? notExpected, T? actual, string? message, params object?[]? parameters) -> void @@ -322,9 +345,72 @@ static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.ThrowsException(Sy static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.ThrowsExceptionAsync(System.Func! action) -> System.Threading.Tasks.Task! static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.ThrowsExceptionAsync(System.Func! action, string! message) -> System.Threading.Tasks.Task! static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.ThrowsExceptionAsync(System.Func! action, string! message, params object?[]? parameters) -> System.Threading.Tasks.Task! +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreInstancesOfType(System.Collections.ICollection? collection, System.Type? expectedType) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreInstancesOfType(System.Collections.ICollection? collection, System.Type? expectedType, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreInstancesOfType(System.Collections.ICollection? collection, System.Type? expectedType, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreNotNull(System.Collections.ICollection? collection) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreNotNull(System.Collections.ICollection? collection, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreNotNull(System.Collections.ICollection? collection, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreUnique(System.Collections.ICollection? collection) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreUnique(System.Collections.ICollection? collection, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreUnique(System.Collections.ICollection? collection, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.Contains(System.Collections.ICollection? collection, object? element) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.Contains(System.Collections.ICollection? collection, object? element, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.Contains(System.Collections.ICollection? collection, object? element, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.DoesNotContain(System.Collections.ICollection? collection, object? element) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.DoesNotContain(System.Collections.ICollection? collection, object? element, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.DoesNotContain(System.Collections.ICollection? collection, object? element, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsNotSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsNotSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsNotSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset, string? message, params object?[]? parameters) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.That.get -> Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert! static Microsoft.VisualStudio.TestTools.UnitTesting.Logging.Logger.LogMessage(string! format, params object?[]! args) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Logging.Logger.OnLogMessage -> Microsoft.VisualStudio.TestTools.UnitTesting.Logging.Logger.LogMessageHandler? +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring, string? message, System.StringComparison comparisonType) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring, string? message, System.StringComparison comparisonType, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring, System.StringComparison comparisonType) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.DoesNotMatch(string? value, System.Text.RegularExpressions.Regex? pattern) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.DoesNotMatch(string? value, System.Text.RegularExpressions.Regex? pattern, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.DoesNotMatch(string? value, System.Text.RegularExpressions.Regex? pattern, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring, string? message, System.StringComparison comparisonType) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring, string? message, System.StringComparison comparisonType, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring, System.StringComparison comparisonType) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Matches(string? value, System.Text.RegularExpressions.Regex? pattern) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Matches(string? value, System.Text.RegularExpressions.Regex? pattern, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Matches(string? value, System.Text.RegularExpressions.Regex? pattern, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring, string? message) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring, string? message, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring, string? message, System.StringComparison comparisonType) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring, string? message, System.StringComparison comparisonType, params object?[]? parameters) -> void +static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring, System.StringComparison comparisonType) -> void static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.That.get -> Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert! static readonly Microsoft.VisualStudio.TestTools.UnitTesting.ClassCleanupExecutionAttribute.DefaultClassCleanupLifecycle -> Microsoft.VisualStudio.TestTools.UnitTesting.ClassCleanupBehavior static readonly Microsoft.VisualStudio.TestTools.UnitTesting.DataSourceAttribute.DefaultDataAccessMethod -> Microsoft.VisualStudio.TestTools.UnitTesting.DataAccessMethod diff --git a/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt b/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt index 646944d390..ab058de62d 100644 --- a/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt +++ b/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt @@ -1,87 +1 @@ #nullable enable -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute() -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, object? arg14) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, object? arg14, object? arg15) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, object? arg14, object? arg15, object? arg16) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(string? notExpected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreInstancesOfType(System.Collections.ICollection? collection, System.Type? expectedType) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreInstancesOfType(System.Collections.ICollection? collection, System.Type? expectedType, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreInstancesOfType(System.Collections.ICollection? collection, System.Type? expectedType, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreNotNull(System.Collections.ICollection? collection) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreNotNull(System.Collections.ICollection? collection, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreNotNull(System.Collections.ICollection? collection, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreUnique(System.Collections.ICollection? collection) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreUnique(System.Collections.ICollection? collection, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AllItemsAreUnique(System.Collections.ICollection? collection, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEqual(System.Collections.ICollection? expected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEqual(System.Collections.ICollection? notExpected, System.Collections.ICollection? actual, System.Collections.IComparer? comparer, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.AreNotEquivalent(System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.Contains(System.Collections.ICollection? collection, object? element) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.Contains(System.Collections.ICollection? collection, object? element, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.Contains(System.Collections.ICollection? collection, object? element, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.DoesNotContain(System.Collections.ICollection? collection, object? element) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.DoesNotContain(System.Collections.ICollection? collection, object? element, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.DoesNotContain(System.Collections.ICollection? collection, object? element, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsNotSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsNotSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsNotSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.CollectionAssert.IsSubsetOf(System.Collections.ICollection? subset, System.Collections.ICollection? superset, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring, string? message, System.StringComparison comparisonType) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring, string? message, System.StringComparison comparisonType, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Contains(string? value, string? substring, System.StringComparison comparisonType) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.DoesNotMatch(string? value, System.Text.RegularExpressions.Regex? pattern) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.DoesNotMatch(string? value, System.Text.RegularExpressions.Regex? pattern, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.DoesNotMatch(string? value, System.Text.RegularExpressions.Regex? pattern, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring, string? message, System.StringComparison comparisonType) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring, string? message, System.StringComparison comparisonType, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.EndsWith(string? value, string? substring, System.StringComparison comparisonType) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Matches(string? value, System.Text.RegularExpressions.Regex? pattern) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Matches(string? value, System.Text.RegularExpressions.Regex? pattern, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.Matches(string? value, System.Text.RegularExpressions.Regex? pattern, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring, string? message, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring, string? message, System.StringComparison comparisonType) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring, string? message, System.StringComparison comparisonType, params object?[]? parameters) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert.StartsWith(string? value, string? substring, System.StringComparison comparisonType) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(string? expected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(string? expected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture, string? message) -> void -static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(string? expected, string? actual, bool ignoreCase, System.Globalization.CultureInfo? culture, string? message, params object?[]? parameters) -> void From 738eabc7e8577526b1654f5dba6063e2cc12e866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Fri, 28 Apr 2023 15:15:40 +0200 Subject: [PATCH 3/8] Use Test Platform 17.4.1 instead of 17.4.0 --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index d8db9c4df3..ffb1021800 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -6,7 +6,7 @@ release false - 17.4.0 + 17.4.1 0.2.0 5.11.0 From 1a33b1d7eac9dfeb16aa4048480236ab159bb6cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Wed, 3 May 2023 10:36:07 +0200 Subject: [PATCH 4/8] Remove DataRowAttribute argument count limitation (#1646) --- .../Extensions/MethodInfoExtensions.cs | 12 +- .../Attributes/DataSource/DataRowAttribute.cs | 297 ++---------------- .../PublicAPI/PublicAPI.Shipped.txt | 16 - .../PublicAPI/PublicAPI.Unshipped.txt | 2 + 4 files changed, 44 insertions(+), 283 deletions(-) diff --git a/src/Adapter/MSTest.TestAdapter/Extensions/MethodInfoExtensions.cs b/src/Adapter/MSTest.TestAdapter/Extensions/MethodInfoExtensions.cs index ba42eb8d3e..77585b8136 100644 --- a/src/Adapter/MSTest.TestAdapter/Extensions/MethodInfoExtensions.cs +++ b/src/Adapter/MSTest.TestAdapter/Extensions/MethodInfoExtensions.cs @@ -152,7 +152,17 @@ internal static void InvokeAsSynchronousTask(this MethodInfo methodInfo, object? throw new TestFailedException(ObjectModel.UnitTestOutcome.Error, Resource.UTA_TestMethodExpectedParameters); } - var task = methodInfo.Invoke(classInstance, parameters) as Task; + Task? task; + if (parameters is not null + && methodParameters?.Length == 1 + && methodParameters[0].ParameterType == typeof(object[])) + { + task = methodInfo.Invoke(classInstance, new[] { parameters }) as Task; + } + else + { + task = methodInfo.Invoke(classInstance, parameters) as Task; + } // If methodInfo is an Async method, wait for returned task task?.GetAwaiter().GetResult(); diff --git a/src/TestFramework/TestFramework/Attributes/DataSource/DataRowAttribute.cs b/src/TestFramework/TestFramework/Attributes/DataSource/DataRowAttribute.cs index 9fb767db17..88317283f5 100644 --- a/src/TestFramework/TestFramework/Attributes/DataSource/DataRowAttribute.cs +++ b/src/TestFramework/TestFramework/Attributes/DataSource/DataRowAttribute.cs @@ -19,275 +19,34 @@ public class DataRowAttribute : Attribute, ITestDataSource /// Initializes a new instance of the class. /// public DataRowAttribute() - => Data = Array.Empty(); + : this(Array.Empty()) + { + } /// /// Initializes a new instance of the class. /// - /// The first argument. - // Need to have this constructor explicitly to fix a CLS compliance error. - public DataRowAttribute(object? arg1) - => Data = new object?[] { arg1 }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - public DataRowAttribute(object? arg1, object? arg2) - => Data = new object?[] { arg1, arg2 }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3) - => Data = new object?[] { arg1, arg2, arg3 }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4) - => Data = new object?[] { arg1, arg2, arg3, arg4 }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5) - => Data = new object?[] { arg1, arg2, arg3, arg4, arg5 }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6) - => Data = new object?[] { arg1, arg2, arg3, arg4, arg5, arg6 }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - /// The seventh argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, - object? arg7) - => Data = new object?[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7 }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - /// The seventh argument. - /// The eight argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, - object? arg7, object? arg8) - => Data = new object?[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - /// The seventh argument. - /// The eight argument. - /// The nineth argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, - object? arg7, object? arg8, object? arg9) - => Data = new object?[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - /// The seventh argument. - /// The eight argument. - /// The nineth argument. - /// The tenth argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, - object? arg7, object? arg8, object? arg9, object? arg10) - => Data = new object?[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - /// The seventh argument. - /// The eight argument. - /// The nineth argument. - /// The tenth argument. - /// The eleventh argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, - object? arg7, object? arg8, object? arg9, object? arg10, object? arg11) - => Data = new object?[] - { - arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, - }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - /// The seventh argument. - /// The eight argument. - /// The nineth argument. - /// The tenth argument. - /// The eleventh argument. - /// The twelfth argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, - object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12) - => Data = new object?[] - { - arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, - }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - /// The seventh argument. - /// The eight argument. - /// The nineth argument. - /// The tenth argument. - /// The eleventh argument. - /// The twelfth argument. - /// The thirteen argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, - object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13) - => Data = new object?[] - { - arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, - arg12, arg13, - }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - /// The seventh argument. - /// The eight argument. - /// The nineth argument. - /// The tenth argument. - /// The eleventh argument. - /// The twelfth argument. - /// The thirteen argument. - /// The fourteenth argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, - object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, - object? arg14) - => Data = new object?[] - { - arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, - arg12, arg13, arg14, - }; + /// The string array data. + public DataRowAttribute(string?[]? stringArrayData) + : this(new object?[] { stringArrayData }) + { + } /// /// Initializes a new instance of the class which takes in an array of arguments. /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - /// The seventh argument. - /// The eight argument. - /// The nineth argument. - /// The tenth argument. - /// The eleventh argument. - /// The twelfth argument. - /// The thirteen argument. - /// The fourteenth argument. - /// The fifteenth argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, - object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, - object? arg14, object? arg15) - => Data = new object?[] + /// The data. + public DataRowAttribute(params object?[]? data) + { + if (data == null) { - arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, - arg12, arg13, arg14, arg15, - }; - - /// - /// Initializes a new instance of the class which takes in an array of arguments. - /// - /// The first argument. - /// The second argument. - /// The third argument. - /// The fourth argument. - /// The fifth argument. - /// The sixth argument. - /// The seventh argument. - /// The eight argument. - /// The nineth argument. - /// The tenth argument. - /// The eleventh argument. - /// The twelfth argument. - /// The thirteen argument. - /// The fourteenth argument. - /// The fifteenth argument. - /// The sixteenth argument. - public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, - object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, - object? arg14, object? arg15, object? arg16) - => Data = new object?[] + Data = new object?[] { null }; + } + else { - arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, - arg12, arg13, arg14, arg15, arg16, - }; + Data = data; + } + } /// /// Gets data for calling test method. @@ -313,15 +72,21 @@ public DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, return DisplayName; } - if (data != null) + if (data == null) { - // We want to force call to `data.AsEnumerable()` to ensure that objects are casted to strings (using ToString()) - // so that null do appear as "null". If you remove the call, and do string.Join(",", new object[] { null, "a" }), - // you will get empty string while with the call you will get "null,a". - return string.Format(CultureInfo.CurrentCulture, FrameworkMessages.DataDrivenResultDisplayName, methodInfo.Name, - string.Join(",", data.AsEnumerable())); + return null; } - return null; + var parameters = methodInfo.GetParameters(); + + // We want to force call to `data.AsEnumerable()` to ensure that objects are casted to strings (using ToString()) + // so that null do appear as "null". If you remove the call, and do string.Join(",", new object[] { null, "a" }), + // you will get empty string while with the call you will get "null,a". + IEnumerable displayData = parameters.Length == 1 && parameters[0].ParameterType == typeof(object[]) + ? new object[] { data.AsEnumerable() } + : data.AsEnumerable(); + + return string.Format(CultureInfo.CurrentCulture, FrameworkMessages.DataDrivenResultDisplayName, methodInfo.Name, + string.Join(",", displayData)); } } diff --git a/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Shipped.txt b/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Shipped.txt index 8f34905b36..e4323ee449 100644 --- a/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Shipped.txt +++ b/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Shipped.txt @@ -45,22 +45,6 @@ Microsoft.VisualStudio.TestTools.UnitTesting.DataAccessMethod.Sequential = 0 -> Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.Data.get -> object?[]! Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute() -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, object? arg14) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, object? arg14, object? arg15) -> void -Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, object? arg11, object? arg12, object? arg13, object? arg14, object? arg15, object? arg16) -> void Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DisplayName.get -> string? Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DisplayName.set -> void Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.GetData(System.Reflection.MethodInfo! methodInfo) -> System.Collections.Generic.IEnumerable! diff --git a/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt b/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt index ab058de62d..48f7321e0e 100644 --- a/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt +++ b/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt @@ -1 +1,3 @@ #nullable enable +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(params object?[]? data) -> void +Microsoft.VisualStudio.TestTools.UnitTesting.DataRowAttribute.DataRowAttribute(string?[]? stringArrayData) -> void From a7c68c0649dafa4f4e1580aec900fd05460d66c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Fri, 12 May 2023 10:59:45 +0200 Subject: [PATCH 5/8] Revert usage of System.Collections.Immutable for TypeCache We have received some complaints from some users running MSTest on old machines where this package is not available (no .NET installed) causing some runtime load error. --- .../MSTest.TestAdapter/Execution/TypeCache.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Adapter/MSTest.TestAdapter/Execution/TypeCache.cs b/src/Adapter/MSTest.TestAdapter/Execution/TypeCache.cs index cce5e2a2e8..cdca1ec94d 100644 --- a/src/Adapter/MSTest.TestAdapter/Execution/TypeCache.cs +++ b/src/Adapter/MSTest.TestAdapter/Execution/TypeCache.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Collections.Immutable; using System.Globalization; using System.Linq; using System.Reflection; @@ -72,24 +71,24 @@ internal TypeCache(ReflectHelper reflectionHelper) /// /// Gets Class Info cache which has cleanup methods to execute. /// - public ImmutableArray ClassInfoListWithExecutableCleanupMethods => - _classInfoCache.Values.Where(classInfo => classInfo.HasExecutableCleanupMethod).ToImmutableArray(); + public IReadOnlyCollection ClassInfoListWithExecutableCleanupMethods => + _classInfoCache.Values.Where(classInfo => classInfo.HasExecutableCleanupMethod).ToList(); /// /// Gets Assembly Info cache which has cleanup methods to execute. /// - public ImmutableArray AssemblyInfoListWithExecutableCleanupMethods => - _testAssemblyInfoCache.Values.Where(assemblyInfo => assemblyInfo.HasExecutableCleanupMethod).ToImmutableArray(); + public IReadOnlyCollection AssemblyInfoListWithExecutableCleanupMethods => + _testAssemblyInfoCache.Values.Where(assemblyInfo => assemblyInfo.HasExecutableCleanupMethod).ToList(); /// /// Gets the set of cached assembly info values. /// - public ImmutableArray AssemblyInfoCache => _testAssemblyInfoCache.Values.ToImmutableArray(); + public IReadOnlyCollection AssemblyInfoCache => _testAssemblyInfoCache.Values.ToList(); /// /// Gets the set of cached class info values. /// - public ImmutableArray ClassInfoCache => _classInfoCache.Values.ToImmutableArray(); + public IReadOnlyCollection ClassInfoCache => _classInfoCache.Values.ToList(); /// /// Get the test method info corresponding to the parameter test Element. From 3bd8304009c68e21806f9c06039e8671028cca70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Fri, 12 May 2023 11:27:47 +0200 Subject: [PATCH 6/8] Fix TypeCache --- .../MSTest.TestAdapter/Execution/TypeCache.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Adapter/MSTest.TestAdapter/Execution/TypeCache.cs b/src/Adapter/MSTest.TestAdapter/Execution/TypeCache.cs index cdca1ec94d..5237216819 100644 --- a/src/Adapter/MSTest.TestAdapter/Execution/TypeCache.cs +++ b/src/Adapter/MSTest.TestAdapter/Execution/TypeCache.cs @@ -71,24 +71,24 @@ internal TypeCache(ReflectHelper reflectionHelper) /// /// Gets Class Info cache which has cleanup methods to execute. /// - public IReadOnlyCollection ClassInfoListWithExecutableCleanupMethods => - _classInfoCache.Values.Where(classInfo => classInfo.HasExecutableCleanupMethod).ToList(); + public TestClassInfo[] ClassInfoListWithExecutableCleanupMethods => + _classInfoCache.Values.Where(classInfo => classInfo.HasExecutableCleanupMethod).ToArray(); /// /// Gets Assembly Info cache which has cleanup methods to execute. /// - public IReadOnlyCollection AssemblyInfoListWithExecutableCleanupMethods => - _testAssemblyInfoCache.Values.Where(assemblyInfo => assemblyInfo.HasExecutableCleanupMethod).ToList(); + public TestAssemblyInfo[] AssemblyInfoListWithExecutableCleanupMethods => + _testAssemblyInfoCache.Values.Where(assemblyInfo => assemblyInfo.HasExecutableCleanupMethod).ToArray(); /// /// Gets the set of cached assembly info values. /// - public IReadOnlyCollection AssemblyInfoCache => _testAssemblyInfoCache.Values.ToList(); + public TestAssemblyInfo[] AssemblyInfoCache => _testAssemblyInfoCache.Values.ToArray(); /// /// Gets the set of cached class info values. /// - public IReadOnlyCollection ClassInfoCache => _classInfoCache.Values.ToList(); + public TestClassInfo[] ClassInfoCache => _classInfoCache.Values.ToArray(); /// /// Get the test method info corresponding to the parameter test Element. From 507b734828b24ce3dc6afc20864c7994f5a427e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Thu, 18 May 2023 19:38:26 +0200 Subject: [PATCH 7/8] Fix assembly resolution error (#1670) --- .../Utilities/AssemblyUtility.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/AssemblyUtility.cs b/src/Adapter/MSTestAdapter.PlatformServices/Utilities/AssemblyUtility.cs index a3c6ae358a..ac313126d0 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/AssemblyUtility.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Utilities/AssemblyUtility.cs @@ -215,6 +215,17 @@ internal virtual string[] GetFullPathToDependentAssemblies(string assemblyPath, AppDomain? appDomain = null; try { + // Force loading the resource assembly into the current domain so that we can get the resource strings even + // when the custom assembly resolver kicks in. + // This should not be required based on the algorithm followed during the satellite assembly resolution + // https://learn.microsoft.com/dotnet/core/extensions/package-and-deploy-resources#net-framework-resource-fallback-process + // BUT for some unknown reason the point 10 is not working as explained. + // Satellite resolution should fallback to the NeutralResourcesLanguageAttribute that we set to en but don't + // resulting in a FileNotFoundException. + // See https://github.com/microsoft/testfx/issues/1598 for the error and https://github.com/microsoft/vstest/pull/4150 + // for the idea of the fix. + _ = string.Format(CultureInfo.InvariantCulture, Resource.CannotFindFile, string.Empty); + appDomain = AppDomain.CreateDomain("Dependency finder domain", null, setupInfo); if (EqtTrace.IsInfoEnabled) { From fb6613b2807c6ef370906f7e5c0e1a3aa1385712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Sun, 21 May 2023 14:24:21 +0200 Subject: [PATCH 8/8] Revert change for timeout test execution (#1675) --- .../Services/ThreadOperations.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/ThreadOperations.cs b/src/Adapter/MSTestAdapter.PlatformServices/Services/ThreadOperations.cs index f97094913c..28b38a2348 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/ThreadOperations.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Services/ThreadOperations.cs @@ -23,6 +23,39 @@ public class ThreadOperations : IThreadOperations /// Returns true if the action executed before the timeout. returns false otherwise. public bool Execute(Action action, int timeout, CancellationToken cancelToken) { +#if NETFRAMEWORK + if (cancelToken.IsCancellationRequested) + { + return false; + } + + Thread executionThread = new(new ThreadStart(action)) + { + IsBackground = true, + Name = "MSTest Test Execution Thread", + }; + + var isUserCancelled = false; + cancelToken.Register(() => isUserCancelled = true); + + // This is not ideal and should be replaced with a mechanism that use STA thread only for tests that need it + // (based on user configuration). We are currently relying on testhost to be STA or MTA and will run ALL tests + // in this mode which is not ideal for different hosting mechanism not for performance. + executionThread.SetApartmentState(Thread.CurrentThread.GetApartmentState()); + executionThread.Start(); + + if (executionThread.Join(timeout)) + { + if (isUserCancelled) + { + return false; + } + + return true; + } + + return false; +#else try { var executionTask = Task.Run(action, cancelToken); @@ -41,5 +74,6 @@ public bool Execute(Action action, int timeout, CancellationToken cancelToken) // Task execution canceled. return false; } +#endif } }