public void GetHashCodeTest() { var id = Guid.NewGuid(); var attendee = new Attendee("Person1", "*****@*****.**", "1234567890", true, new List <MeetingInfo>()); var hashCodeBefore = attendee.GetHashCode(); attendee.AttendeeId = id; var hashCodeAfter = attendee.GetHashCode(); Assert.That(hashCodeBefore == hashCodeAfter, Is.False); var newCopyId = Guid.Parse(id.ToString()); attendee.AttendeeId = newCopyId; var hashCodeFinal = attendee.GetHashCode(); Assert.That(hashCodeAfter == hashCodeFinal, Is.True); }
public void Attendees_Tests(Attendee actual, Attendee expected) { Assert.AreEqual(expected.GetHashCode(), actual.GetHashCode()); Assert.AreEqual(expected, actual); }