From f1bd0d063f0357aa55e4d09f935f11ebfe653b83 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Fri, 16 Jan 2026 13:47:35 +0100 Subject: [PATCH 1/3] Avoid using init for TestMethod attribute properties --- .../Attributes/TestMethod/TestMethodAttribute.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TestFramework/TestFramework/Attributes/TestMethod/TestMethodAttribute.cs b/src/TestFramework/TestFramework/Attributes/TestMethod/TestMethodAttribute.cs index 380f2ae8cf..75a9bdba34 100644 --- a/src/TestFramework/TestFramework/Attributes/TestMethod/TestMethodAttribute.cs +++ b/src/TestFramework/TestFramework/Attributes/TestMethod/TestMethodAttribute.cs @@ -45,12 +45,12 @@ public TestMethodAttribute([CallerFilePath] string callerFilePath = "", [CallerL /// /// Gets display name for the test. /// - public string? DisplayName { get; init; } + public string? DisplayName { get; set; } /// /// Gets the strategy for unfolding parameterized tests. /// - public TestDataSourceUnfoldingStrategy UnfoldingStrategy { get; init; } = TestDataSourceUnfoldingStrategy.Auto; + public TestDataSourceUnfoldingStrategy UnfoldingStrategy { get; set; } = TestDataSourceUnfoldingStrategy.Auto; /// /// Gets the file path that declares the attribute. From ef3e095bd2ceec8ec1d8d89235b1fc6a70bdcfa5 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Fri, 16 Jan 2026 14:01:05 +0100 Subject: [PATCH 2/3] Update PublicAPI files --- .../TestFramework/PublicAPI/PublicAPI.Unshipped.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt b/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt index cfabfe29c5..ee959a8a46 100644 --- a/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt +++ b/src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt @@ -55,3 +55,7 @@ static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNotExactInstanceOfT static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNotExactInstanceOfType(object? value, string? message = "", string! valueExpression = "") -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNotExactInstanceOfType(object? value, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertGenericIsNotExactInstanceOfTypeInterpolatedStringHandler message, string! valueExpression = "") -> void static Microsoft.VisualStudio.TestTools.UnitTesting.Assert.ContainsSingle(System.Collections.IEnumerable! collection, string? message = "", string! collectionExpression = "") -> object? +*REMOVED*Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute.DisplayName.init -> void +*REMOVED*Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute.UnfoldingStrategy.init -> void +Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute.DisplayName.set -> void +Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute.UnfoldingStrategy.set -> void From 16ec8b04da8d7bc053053d28ce1bbeef2fea6299 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Fri, 16 Jan 2026 14:08:31 +0100 Subject: [PATCH 3/3] Fix doc comment --- .../Attributes/TestMethod/TestMethodAttribute.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TestFramework/TestFramework/Attributes/TestMethod/TestMethodAttribute.cs b/src/TestFramework/TestFramework/Attributes/TestMethod/TestMethodAttribute.cs index 75a9bdba34..08db46f3d8 100644 --- a/src/TestFramework/TestFramework/Attributes/TestMethod/TestMethodAttribute.cs +++ b/src/TestFramework/TestFramework/Attributes/TestMethod/TestMethodAttribute.cs @@ -43,12 +43,12 @@ public TestMethodAttribute([CallerFilePath] string callerFilePath = "", [CallerL } /// - /// Gets display name for the test. + /// Gets or sets display name for the test. /// public string? DisplayName { get; set; } /// - /// Gets the strategy for unfolding parameterized tests. + /// Gets or sets the strategy for unfolding parameterized tests. /// public TestDataSourceUnfoldingStrategy UnfoldingStrategy { get; set; } = TestDataSourceUnfoldingStrategy.Auto;