Exemplo n.º 1
0
        public void GetHashCode_EntitiesWithSameIdentityComponents_ReturnsSameValue(DomainEntity a, DomainEntity b)
        {
            // Act
            var hashCodeOfA = a.GetHashCode();
            var hashCodeOfB = b.GetHashCode();

            // Assert
            hashCodeOfA.Should().Be(hashCodeOfB, "because objects are semantically equal.");
        }
Exemplo n.º 2
0
        public void GetHashCode_EntitiesWithDifferentIdentityComponents_ReturnsDifferentValues(DomainEntity a, DomainEntity b)
        {
            // Act
            var hashCodeOfA = a.GetHashCode();
            var hashCodeOfB = b.GetHashCode();

            // Assert
            hashCodeOfA.Should().NotBe(hashCodeOfB, "because objects are semantically different.");
        }