예제 #1
0
 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));
 }
예제 #2
0
 public void SameInstanceIsEqual() {
     var bar = new EntityWithStringPrimaryKey { Id = "123" };
     Assert.True(bar.Equals(bar));
 }
예제 #3
0
 public void EqualsNonBarIsFalse() {
     var bar = new EntityWithStringPrimaryKey();
     Assert.False(bar.Equals(new Foo()));
 }
예제 #4
0
 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));
 }
예제 #5
0
 public void EqualsNullIsFalse() {
     var bar = new EntityWithStringPrimaryKey();
     Assert.False(bar.Equals(null));
 }