public void SamePrimaryKeyEqual() { var pk = "123"; var bar = new EntityWithStringPrimaryKey { Id = pk }; var otherBar = new EntityWithStringPrimaryKey { Id = pk }; Assert.True(bar.Equals(otherBar)); Assert.True(otherBar.Equals(bar)); }
public void SameInstanceIsEqual() { var bar = new EntityWithStringPrimaryKey { Id = "123" }; Assert.True(bar.Equals(bar)); }
public void EqualsNonBarIsFalse() { var bar = new EntityWithStringPrimaryKey(); Assert.False(bar.Equals(new Foo())); }
public void NonSamePrimaryKeyNotEqual() { var bar = new EntityWithStringPrimaryKey { Id = "123" }; var otherBar = new EntityWithStringPrimaryKey { Id = "456" }; Assert.False(bar.Equals(otherBar)); Assert.False(otherBar.Equals(bar)); }
public void EqualsNullIsFalse() { var bar = new EntityWithStringPrimaryKey(); Assert.False(bar.Equals(null)); }