Luke Winter wrote:I find it hard to believe that assertEquals is wrong but I can't for the life of me tell the difference between these two outputs:
...
In the compare window, no red is shown. I pasted actual and expected into separate textfiles, compared the difference with Eclipse and nothing was found. Other tests that compare output are passing, it is just this one. Help please?
Have you thought about putting your directions in a
Direction enum?
To be honest, I'm not quite sure what all these String comparisons are doing - the Strings themselves appear to be some sort of indicator of direction, but I'm still not sure exactly how. If you put them in an enum, you could add an
asString() method (or override
toString()) that returns the display String for a particular
Direction.
Better still, you could then compare
Directions rather than Strings.
Winston