views:

41

answers:

3

I wonder if the order is important? What do you think?

+5  A: 

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.

Jon Skeet
A: 

The error messages for a failing task depend on it - other developers will expected them to be in the right order.

Jackson Pope
+2  A: 

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

Jonny Cundall