Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 499673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:00:34+00:00 2026-05-13T06:00:34+00:00

The caption may sound a little weird. Allow me to elaborate using an example.

  • 0

The caption may sound a little weird. Allow me to elaborate using an example.

The Object.Equals function usually requires that a.Equals(a) returns true. Unless you’re doing something twisted in your code, every class should adhere to this rule.

So we could write a generic unittest that checks all available classes to comply. (We might exclude classes explicitly marked by some attribute.)

And instead of just using Equals, we’re also checking for correct behavior of all implementations of, say, IComparer and whatever standard interface you can imagine.

Now, my question is: Does this exist already? If not, why would it be a bad idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:00:35+00:00Added an answer on May 13, 2026 at 6:00 am

    I’m not aware of the existence of such a thing, but it sounds like a fine idea.

    This is on the border of a convetion-based test and static code analysis – you could just as well imagine such a rule written as a custom Code Analysis rule, but it’s probably easier to write it as a unit test.

    In our latest project, we have some convention-based tests that simply loop through all types in a given assembly and verifies that it conforms to some convention that we have. One could definitely imagine doing the same with e.g. the Equals method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this caption function that worlds great. If I fill in the alt
We're using code that we've used before, so I suspect that this may be
I use jQuery to fade in a caption on a icon mouseover. $(#v1).mouseover(function() {
Trying to do an image caption but can't figure the this object selector right
Double-clicking a TStaticText on a form copies the caption of that TStaticText to the
I think I may be trying something that isn't possible. I was recently tasked
Sorry for the weird caption. What I'm trying to achieve is simple: IEnumerable<IEnumerable<Foo>> listoflist;
I've written a little ruby script that lets me send emails by calling it
I have a JavaScript function that I use to call the Facebook API and
I have create an xla (excel add-in) that have a function to protect the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.