public void SamePrimaryKeyEqual() { var guid = Guid.NewGuid(); var bar = new EntityWithGuidPrimaryKey { Id = guid }; var otherBar = new EntityWithGuidPrimaryKey { Id = guid }; Assert.True(bar.Equals(otherBar)); Assert.True(otherBar.Equals(bar)); }
public void SameInstanceIsEqual() { var bar = new EntityWithGuidPrimaryKey { Id = Guid.NewGuid() }; Assert.True(bar.Equals(bar)); }
public void EqualsNonBarIsFalse() { var bar = new EntityWithGuidPrimaryKey(); Assert.False(bar.Equals(new Foo())); }
public void NonSamePrimaryKeyNotEqual() { var bar = new EntityWithGuidPrimaryKey { Id = Guid.NewGuid() }; var otherBar = new EntityWithGuidPrimaryKey { Id = Guid.NewGuid() }; Assert.False(bar.Equals(otherBar)); Assert.False(otherBar.Equals(bar)); }
public void EqualsNullIsFalse() { var bar = new EntityWithGuidPrimaryKey(); Assert.False(bar.Equals(null)); }