From 31b9598ed24d92037ab74c8df0aac41b3bffefad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Mon, 16 Dec 2024 21:13:19 +0100 Subject: [PATCH] Don't make TestDataSourceDiscoveryOption obsolete (#4366) --- src/Adapter/MSTest.TestAdapter/Helpers/ReflectHelper.cs | 1 - .../DataSource/TestDataSourceDiscoveryAttribute.cs | 8 +++----- .../DataSource/TestDataSourceDiscoveryOption.cs | 8 +++----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Adapter/MSTest.TestAdapter/Helpers/ReflectHelper.cs b/src/Adapter/MSTest.TestAdapter/Helpers/ReflectHelper.cs index e4f3968e35..f321c9fb10 100644 --- a/src/Adapter/MSTest.TestAdapter/Helpers/ReflectHelper.cs +++ b/src/Adapter/MSTest.TestAdapter/Helpers/ReflectHelper.cs @@ -272,7 +272,6 @@ internal static TestIdGenerationStrategy GetTestIdGenerationStrategy(Assembly as /// Gets TestDataSourceDiscovery assembly level attribute. /// /// The test assembly. - [Obsolete] internal static TestDataSourceDiscoveryOption? GetTestDataSourceDiscoveryOption(Assembly assembly) => PlatformServiceProvider.Instance.ReflectionOperations.GetCustomAttributes(assembly, typeof(TestDataSourceDiscoveryAttribute)) .OfType() diff --git a/src/TestFramework/TestFramework/Attributes/DataSource/TestDataSourceDiscoveryAttribute.cs b/src/TestFramework/TestFramework/Attributes/DataSource/TestDataSourceDiscoveryAttribute.cs index 660735c263..6d957075d6 100644 --- a/src/TestFramework/TestFramework/Attributes/DataSource/TestDataSourceDiscoveryAttribute.cs +++ b/src/TestFramework/TestFramework/Attributes/DataSource/TestDataSourceDiscoveryAttribute.cs @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System.ComponentModel; + namespace Microsoft.VisualStudio.TestTools.UnitTesting; /// /// Specifies how to discover tests. /// [AttributeUsage(AttributeTargets.Assembly)] -#if NET6_0_OR_GREATER -[Obsolete("Attribute is obsolete and will be removed in v4, instead use 'TestDataSourceOptionsAttribute'.", DiagnosticId = "MSTESTOBS")] -#else -[Obsolete("Attribute is obsolete and will be removed in v4, instead use 'TestDataSourceOptionsAttribute'.")] -#endif +[EditorBrowsable(EditorBrowsableState.Never)] public class TestDataSourceDiscoveryAttribute : Attribute { /// diff --git a/src/TestFramework/TestFramework/Attributes/DataSource/TestDataSourceDiscoveryOption.cs b/src/TestFramework/TestFramework/Attributes/DataSource/TestDataSourceDiscoveryOption.cs index 25b9c9b32e..1259baf4a7 100644 --- a/src/TestFramework/TestFramework/Attributes/DataSource/TestDataSourceDiscoveryOption.cs +++ b/src/TestFramework/TestFramework/Attributes/DataSource/TestDataSourceDiscoveryOption.cs @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System.ComponentModel; + namespace Microsoft.VisualStudio.TestTools.UnitTesting; /// /// The supported discovery modes for tests. /// -#if NET6_0_OR_GREATER -[Obsolete("Type is obsolete and will be removed in v4, instead use 'TestDataSourceUnfoldingStrategy'.", DiagnosticId = "MSTESTOBS")] -#else -[Obsolete("Type is obsolete and will be removed in v4, instead use 'TestDataSourceUnfoldingStrategy'.")] -#endif +[EditorBrowsable(EditorBrowsableState.Never)] public enum TestDataSourceDiscoveryOption { ///