Exemplo n.º 1
0
        public void SettingIdReturnsPrevIfGetHashCodeAlreadyCalled()
        {
            var bar  = new EntityWithStringPrimaryKey();
            var hash = bar.GetHashCode();

            bar.Id = "456";
            Assert.Equal(hash, bar.GetHashCode());
        }
Exemplo n.º 2
0
        public void GetHashCodeReturnsIdFactor()
        {
            var bar = new EntityWithStringPrimaryKey {
                Id = "123"
            };

            Assert.Equal(bar.Id.GetHashCode(), bar.GetHashCode());
        }
Exemplo n.º 3
0
        public void NoIdReturnsBaseHashCode()
        {
            var bar = new EntityWithStringPrimaryKey();

            Assert.Equal(RuntimeHelpers.GetHashCode(bar), bar.GetHashCode());
        }