public void NoIdReturnsBaseHashCode() { var bar = new EntityWithGuidPrimaryKey(); Assert.Equal(RuntimeHelpers.GetHashCode(bar), bar.GetHashCode()); }
public void SettingIdReturnsPrevIfGetHashCodeAlreadyCalled() { var bar = new EntityWithGuidPrimaryKey(); var hash = bar.GetHashCode(); bar.Id = Guid.NewGuid(); Assert.Equal(hash, bar.GetHashCode()); }
public void GetHashCodeReturnsIdFactor() { var bar = new EntityWithGuidPrimaryKey { Id = Guid.NewGuid() }; Assert.Equal(bar.Id.GetHashCode(), bar.GetHashCode()); }