Пример #1
0
 public void SameInstanceIsEqual() {
     var bar = new Bar { Id = 3 };
     Assert.True(bar.Equals(bar));
 }
Пример #2
0
 public void SamePrimaryKeyEqual() {
     var bar = new Bar { Id = 2 };
     var otherBar = new Bar { Id = 2 };
     Assert.True(bar.Equals(otherBar));
     Assert.True(otherBar.Equals(bar));
 }
Пример #3
0
 public void EqualsNonBarIsFalse() {
     var bar = new Bar();
     Assert.False(bar.Equals(new Foo()));
 }
Пример #4
0
 public void NonSamePrimaryKeyNotEqual() {
     var bar = new Bar { Id = 1 };
     var otherBar = new Bar { Id = 2 };
     Assert.False(bar.Equals(otherBar));
     Assert.False(otherBar.Equals(bar));
 }
Пример #5
0
 public void EqualsNullIsFalse() {
     var bar = new Bar();
     Assert.False(bar.Equals(null));
 }