public void ValueObjects_WhenNotEqual_HashCodesNotEqual() { // Arrange var vo1 = new FakeValueObject(1, 2, 3); var vo2 = new FakeValueObject(2, 2, 3); // Act var hashCodesEqual = vo1.GetHashCode() == vo2.GetHashCode(); // Assert hashCodesEqual.Should().BeFalse(); }
public void ValueObjects_AreEqual() { // Arrange var vo1 = new FakeValueObject(1, 2, 3); var vo2 = new FakeValueObject(1, 2, 3); // Act var areEqual = vo1 == vo2; // Assert areEqual.Should().BeTrue(); }
public void ValueObjects_WhenEqual_HaveEqualHashCodes() { // Arrange var vo1 = new FakeValueObject(1, 2, 3); var vo2 = new FakeValueObject(1, 2, 3); // Act var hashCodesEqual = vo1.GetHashCode() == vo2.GetHashCode(); // Assert hashCodesEqual.Should().BeTrue(); }