예제 #1
0
 public void NoIdReturnsBaseHashCode() {
     var bar = new Bar();
     Assert.Equal(RuntimeHelpers.GetHashCode(bar), bar.GetHashCode());
 }
예제 #2
0
 public void SettingIdReturnsPrevIfGetHashCodeAlreadyCalled() {
     var bar = new Bar();
     var hash = bar.GetHashCode();
     bar.Id = 3;
     Assert.Equal(hash, bar.GetHashCode());
 }
예제 #3
0
 public void GetHashCodeReturnsIdFactor() {
     var bar = new Bar { Id = 3 };
     Assert.Equal(17 * 3, bar.GetHashCode());
 }