Tag Archives: TDD

[JUnit] assertEqual vs assertSame

Found a good explanation on Stackoverflow about this 

http://stackoverflow.com/questions/2882337/junit-assertsame

Actually this is for assertSame, but we can differentiate assertEqual from this easily.

So, for short words, assertSame works on reference objects and assertEqual for equality of values between objects.