Exemplo n.º 1
0
        public void NotEqualToOperator_OperandsWithSameIdentityComponents_ReturnsFalse(DomainEntity a, DomainEntity b)
        {
            // Act
            var result = a != b;

            // Assert
            result.Should().BeFalse("because operands are non-null instance of the same type and semantically equal.");
        }
Exemplo n.º 2
0
        public void Equals_ToEntityWithDifferentIdentityComponents_ReturnsFalse(DomainEntity a, DomainEntity b)
        {
            // Act
            var result = a.Equals(b);

            // Assert
            result.Should().BeFalse("because argument is non-null instance of the same type but semantically different from current object.");
        }
Exemplo n.º 3
0
        public void NotEqualToOperator_OperandsWithDifferentTypes_ReturnsTrue(DomainEntity a, DomainEntity b)
        {
            // Act
            var result = a != b;

            // Assert
            result.Should().BeTrue("because operands are non-null instances of a different type.");
        }
Exemplo n.º 4
0
        public void NotEqualToOperator_OperandsWithDifferentIdentityComponents_ReturnsTrue(DomainEntity a, DomainEntity b)
        {
            // Act
            var result = a != b;

            // Assert
            result.Should().BeTrue("because operands are non-null instances of the same type but semantically different.");
        }
Exemplo n.º 5
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.º 6
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.");
        }
Exemplo n.º 7
0
        public void Equals_ToEntityWithSameIdentityComponents_ReturnsTrue(DomainEntity a, DomainEntity b)
        {
            // Act
            var result = a.Equals(b);

            // Assert
            result.Should().BeTrue("because argument is non-null instance of the same type and semantically equal to current object.");
        }