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 explanation I heard is that it comes from TDD.
In Test Driven Development, you start with the test, and then write the code.
Starting assertions by writing the expectation, and then call the code that should produce it, is a mini version of that mindset.
Of course, this may just be a story people tell. Don't know that it was a conscious reason.