PropertyAssertions do not work properly if a class overwrites the Equals-method:
```
class ClassThatOverwritesEquals
{
public int Age { get; set; }
public override bool Equals(object obj) {
return true;
}
}
```
This will never throw if you compare two instances of the same type:
```
var subject = new ClassThatOverwritesEquals {
Age = 36,
};
var expectation = new ClassThatOverwritesEquals {
Age = 37,
};
Action act = () => subject
.ShouldHave()
.AllProperties()
.EqualTo(expectation, "because {0} are the same", "they");
```
I would guess the problem is in ReferenceEqualityEquivalencyStep.cs line 43:
```
return !ReferenceEquals(context.Subject, null) && context.Subject.Equals(context.Expectation);
```
The Equals(..) should be replaced by object.ReferenceEquals(..).
```
class ClassThatOverwritesEquals
{
public int Age { get; set; }
public override bool Equals(object obj) {
return true;
}
}
```
This will never throw if you compare two instances of the same type:
```
var subject = new ClassThatOverwritesEquals {
Age = 36,
};
var expectation = new ClassThatOverwritesEquals {
Age = 37,
};
Action act = () => subject
.ShouldHave()
.AllProperties()
.EqualTo(expectation, "because {0} are the same", "they");
```
I would guess the problem is in ReferenceEqualityEquivalencyStep.cs line 43:
```
return !ReferenceEquals(context.Subject, null) && context.Subject.Equals(context.Expectation);
```
The Equals(..) should be replaced by object.ReferenceEquals(..).