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