Loading ...
Sorry, an error occurred while loading the content.

Re: [junit] AssertNotEquals

Expand Messages
  • Michael Forsberg
    I agree, I though I sent a message in regards to AssertNotEquals versus the AssertNotSame. I think that AssertNotSame should perform the if (objOne ==
    Message 1 of 4 , Jan 29, 2001
    View Source
    • 0 Attachment
      I agree, I though I sent a message in regards to AssertNotEquals versus
      the AssertNotSame. I think that AssertNotSame should perform the

      if (objOne == objTwo) fail(message)

      and the AssertNotEquals

      if objOne.equals(objTwo) fail(message)

      How would I go about submitting the code for approval?

      I would not mind writing the converse of all of the assertXXX() in the
      Assert class.

      David Corbin wrote:
      >
      > I agree that AssertNotEquals should exist, but it should be implemented
      > in such a way that your example would be "very bad". It should in fact
      > be implemented by calling the equals() method, not by comparing
      > references...
      >
      > Michael Forsberg wrote:
      > >
      > > Could someone inform me why there is not an AssertNotEquals(...) method
      > > in the junit.framework.Assert class.
      > >
      > > While coding a test for a copy constructor I noticed the lack of this
      > > method. I think that the ability to a assert that a Copy constructor
      > > does not return a new reference to the same object.
      > >
      > > I understand this could be accomplished via the code...
      > >
      > > if (objOne = objTwo) fail(message);
      > >
      > > but feel the JUnit Classes would benefit from this addition. I would be
      > > glad to discuss this topic and/or write the actual method if and/or when
      > > it is approved.
      > >
      > > Big Mike
      > >
      > >
      > > To unsubscribe from this group, send an email to:
      > > junit-unsubscribe@egroups.com
      >
      > --
      > David Corbin
      > Mach Turtle Technologies, Inc.
      > http://www.machturtle.com
      > dcorbin@...
      >
      >
      > To unsubscribe from this group, send an email to:
      > junit-unsubscribe@egroups.com
    Your message has been successfully submitted and would be delivered to recipients shortly.