Skip to content

Remove deprecated code #3836

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

Merged
merged 1 commit into from
May 30, 2021
Merged

Remove deprecated code #3836

merged 1 commit into from
May 30, 2021

Conversation

rprouse
Copy link
Member

@rprouse rprouse commented Apr 23, 2021

Fixes #3769

I checked each of the obsolete classes, properties and method by searching GitHub for usages with a search like Assert.That extension:cs in:file

As a reference, Assert.That is used 454K times, Assert.AreEqual 1.691 million times and [TestFixture] 2.289 million times.

Based on the low usage of all of this code, I wonder if we can apply the same technique to some of the other classes that we want to make internal or possibly remove?

Types

AssertionHelper Type - Couldn't find usages, removed.

FileExistsConstraint type - Unused

DebugWriter type - Unused

DataAttribute type - Unused

List type - Only a few instance found in repos that haven't been updated in a long time

ListMapper type - Only found in repos using NUnit 2 and forks of NUnit 3

Members

DictionaryContainsKeyConstraint - Usages are hard to search for, but still agree with the deprecation

String Starting/Containing/Ending/Matching functions (replaced by StartsWith/Contains/EndsWith/Matches overloads)

RuntimeType - Interstingly, I couldn't even find recent usages of RuntimeType

CollectionContainsConstraint - Only used in NUnit forks?

Timeout Command - I only found one valid usage of this and left an issue to update it.

WorkItemBuilder - This is used by Saucery by @agray. I can't find other usages, but I will leave it for that project. I am removing the deprecation. Andrew, when this PR is merged, you should check that you aren't using anything else that I removed.

SimpleWorkItem - I can't find usages and the other constructor is available

NUnitEqualityComparer - Around 400 usages, all look to be old forks of NUnit

NUnitLite OptionSet

@rprouse rprouse requested a review from stevenaw April 23, 2021 16:45
@@ -381,11 +381,18 @@ private static bool IsNetCore_Internal()
}
#endif

private static bool IsRuntimeTypeName(string name)
private static RuntimeType ParseRuntimeType(string s)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only new code. Runtime types are often passed in as strings and we allowed "NET" and "NetFramework". With the removal of the Net enum value, this no longer worked.

I'll likely clean this up more when I work on the PlatformAttribute, but this will do for now.

Copy link
Member

@stevenaw stevenaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rprouse ! Sorry it took me a little bit to review this.
Thanks for searching for usages of each of these. I tried to do a bit of the same as part of reviewing and came to the same conclusions.

LGTM 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove code marked "Obsolete"
2 participants