Menu

#278 New JUnitAssertEqualsConstantActualValue rule

None
open
nobody
None
5
2013-05-03
2011-05-03
Chris Mair
No

For calls to assertEquals(x, y), if y is a constant or literal, then it probably (must?) is intended to the expected value, rather than the actual value.

e.g.
assertEquals(links.length,1);
assertEquals(links[0].getText(),"IBM");

Same for assertEquals(String message, x, y).

Discussion

  • Chris Mair

    Chris Mair - 2013-05-01
    • assigned_to: Chris Mair --> nobody
    • Group: -->
     
  • Artur Gajowy

    Artur Gajowy - 2013-05-03

    Fix in https://github.com/CodeNarc/CodeNarc/pull/16 :)

    Best regards,
    Artur Gajowy

     

Log in to post a comment.