示例#1
0
 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));
 }
示例#2
0
 public void SameInstanceIsEqual() {
     var bar = new EntityWithGuidPrimaryKey { Id = Guid.NewGuid() };
     Assert.True(bar.Equals(bar));
 }
示例#3
0
 public void EqualsNonBarIsFalse() {
     var bar = new EntityWithGuidPrimaryKey();
     Assert.False(bar.Equals(new Foo()));
 }
示例#4
0
 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));
 }
示例#5
0
 public void EqualsNullIsFalse() {
     var bar = new EntityWithGuidPrimaryKey();
     Assert.False(bar.Equals(null));
 }