Example #1
0
        public void GetHashCode_Should_Return_Unique_HashCode_If_Id_Is_Not_Set_Yet()
        {
            var entity1 = new TestableEntity1();
            var entity2 = new TestableEntity1();

            Assert.NotEqual(entity1.GetHashCode(), entity2.GetHashCode());
        }
Example #2
0
        public void GetHashCode_Should_Return_Same_HashCode_If_Id_And_Type_Are_Same()
        {
            var entity1 = new TestableEntity1()
            {
                Id = 100, Name = "number 1"
            };
            var entity2 = new TestableEntity1()
            {
                Id = 100, Name = "number 2"
            };

            Assert.Equal(entity1.GetHashCode(), entity2.GetHashCode());
        }