Is the order of the two parameters in Assert.AreEqual(expected, actual) important?
I wonder if the order is important?开发者_C百科 What do you think?
Well, primarily it's important so that if the test fails, the failure message is correct. Otherwise you'll be chasing your tail trying to work out why the expected value looks wrong but the actual value looks right.
It's needed so you have readable failure messages. If your tests fails, you'll get something like
Assert.Equal failed: value should have been X, but was Y
it would be confusing if X and Y were switched
精彩评论