Beispiel #1
0
        public void GetHashCode_SameProperty_ShouldBeEquals()
        {
            // Arrange
            var valueObject1 = new MockValueObjectWithProperty
            {
                Property = "Property"
            };

            var valueObject2 = new MockValueObjectWithProperty
            {
                Property = "Property"
            };

            // Act
            var hashCode1 = valueObject1.GetHashCode();
            var hashCode2 = valueObject2.GetHashCode();

            // Assert
            hashCode1.Should().Be(hashCode2);
        }
Beispiel #2
0
        public void GetHashCode_DifferentProperty_ShouldNotBeEquals()
        {
            // Arrange
            var valueObject1 = new MockValueObjectWithProperty
            {
                Property = "Property1"
            };

            var valueObject2 = new MockValueObjectWithProperty
            {
                Property = "Property2"
            };

            // Act
            var hashCode1 = valueObject1.GetHashCode();
            var hashCode2 = valueObject2.GetHashCode();

            // Assert
            hashCode1.Should().NotBe(hashCode2);
        }