public void Equals_DifferentType_ShouldBeFalse() { // Arrange var valueObject1 = new MockValueObjectWithProperty(); var valueObject2 = new MockValueObjectWithProperties(); // Act var condition = valueObject1 == valueObject2; // Assert condition.Should().BeFalse(); }
public void Equals_SameProperty_ShouldBeTrue() { // Arrange var valueObject1 = new MockValueObjectWithProperty { Property = "Property" }; var valueObject2 = new MockValueObjectWithProperty { Property = "Property" }; // Act var condition = valueObject1.Equals(valueObject2); // Assert condition.Should().BeTrue(); }
public void Equals_DifferentProperty_ShouldBeFalse() { // Arrange var valueObject1 = new MockValueObjectWithProperty { Property = null }; var valueObject2 = new MockValueObjectWithProperty { Property = "Property2" }; // Act var condition = valueObject1.Equals(valueObject2); // Assert condition.Should().BeFalse(); }
public void OperatorNotEquals_DifferentProperty_ShouldBeTrue() { // Arrange var valueObject1 = new MockValueObjectWithProperty { Property = "Property1" }; var valueObject2 = new MockValueObjectWithProperty { Property = "Property2" }; // Act var condition = valueObject1 != valueObject2; // Assert condition.Should().BeTrue(); }
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); }
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); }