From: Kent B. <ke...@th...> - 2003-01-31 13:38:53
|
Line a bunch of assertEquals in a row. Having expected first makes them read better. And yes, it's too late to change it. Kent > -----Original Message----- > From: jun...@li... > [mailto:jun...@li...] On Behalf Of > Janto Dreijer > Sent: Thursday, January 30, 2003 2:42 PM > To: jun...@li... > Subject: [Junit-devel] why not assertEquals(actual, expected)? > > > > Is there a reason why the order of the parameters to > assertEquals are (expected, actual) and not (actual, expected)? > > Say f() returns the string "invalid data". > Then calling > assertEquals( f(), "correct ouput" ) > will print: > expected "invalid data" but found "correct output" > (or something like that) > > Now maybe it's just me, but the result doesn't look very > natural. Neither does the order of the parameters if I were > to swap them around: > assertEquals( "correct ouput", f() ) > It doesn't have the kind of dataflow I think in: left to right. > > I hope you guys don't think it's too late to change the works :-) > > I'm relatively new to jUnit, so if there's something obvious > I'm missing... > > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something > 2 See! http://www.vasoftware.com > _______________________________________________ > Junit-devel mailing list > Jun...@li... > https://lists.sourceforge.net/lists/listinfo/j> unit-devel > |