Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsolete InternalTestFailureException and GenericParameterHelper #4703

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/TestFramework/TestFramework/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.VisualStudio.TestTools.UnitTesting;

/// <summary>
/// Constants used throughout.
/// </summary>
internal static class Constants
{
internal const string PublicTypeObsoleteMessage = "We will remove or hide this type starting with v4. If you are using this type, reach out to our team on https://github.com/microsoft/testfx.";
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting;
/// This class is only added to preserve source compatibility with the V1 framework.
/// For all practical purposes either use AssertFailedException/AssertInconclusiveException.
/// </remarks>
#if RELEASE
#if NET6_0_OR_GREATER
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
#else
[Obsolete(Constants.PublicTypeObsoleteMessage)]
#endif
#endif
[Serializable]
public class InternalTestFailureException : UnitTestAssertException
{
Expand Down
8 changes: 7 additions & 1 deletion src/TestFramework/TestFramework/GenericParameterHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting;
// This next suppression could mask a problem, since Equals and CompareTo may not agree!
[SuppressMessage("Microsoft.Design", "CA1036:OverrideMethodsOnComparableTypes", Justification = "Compat reasons.")]
[SuppressMessage("Design", "CA1010:Generic interface should also be implemented", Justification = "Part of the public API")]

#if RELEASE
#if NET6_0_OR_GREATER
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
#else
[Obsolete(Constants.PublicTypeObsoleteMessage)]
#endif
#endif
// GenericParameterHelper in full CLR version also implements ICloneable, but we don't have ICloneable in core CLR
public class GenericParameterHelper : IComparable, IEnumerable
{
Expand Down
Loading