I have this code where I compare two objects of a simple Card class I created. They reside on a List:
List<Card> aCards = new List<Card>(rows * cols);
The problem is that when I compare two items of that list with the equals operator they return true, but it was supposed to return false, because this operation is reference based and I'm pretty sure the objects in this list are deferents; they were created through a loop, meaning separated scopes. In this case:
bool test1 = aCards[0] == aCards[5];
bool test2 = System.Object.ReferenceEquals(aCards[0], aCards[5]);
The value of test1 is true; test2 is false. As I said it's a simple class, I didn't override any base method. Maybe the Mono default implementation is deferent, I don't know. Hoping for a clarification.
Thanks.