Why do so many assertEquals()
or similar function take the expected value as first parameter and the actual one as second ?
This seems counter-intuitive to me,
The xUnit testing convention is expected/actual. So, for many that is the natural order since that's what they learnt.
Interestingly in a break from convention for an xUnit framework qunit goes for actual/expected. At least with javascript you can just create a new function that encapsulates the old one and assign it the original variable:
var qunitEquals = equals;
equals = function(expected, actual, message) {
qunitEquals(actual, expected, message);
};