public void HashCode_Is_HashCode_Of_Uid() { // arrange var summary = new DocumentSummary { Uid = nameof(DocSummaryTests) }; // act var expected = summary.Uid.GetHashCode(); var actual = summary.GetHashCode(); // assert Assert.Equal(expected, actual); }
public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + (ChangeNumber == default(int) ? 0 : ChangeNumber.GetHashCode()); hash = hash * 23 + (Document1 == null ? 0 : Document1.GetHashCode()); hash = hash * 23 + (DocumentLevel == null ? 0 : DocumentLevel.GetHashCode()); hash = hash * 23 + (DocumentSummary == null ? 0 : DocumentSummary.GetHashCode()); hash = hash * 23 + (FileExtension == null ? 0 : FileExtension.GetHashCode()); hash = hash * 23 + (FileName == null ? 0 : FileName.GetHashCode()); hash = hash * 23 + (FolderFlag == default(bool) ? 0 : FolderFlag.GetHashCode()); hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode()); hash = hash * 23 + (Owner == default(int) ? 0 : Owner.GetHashCode()); hash = hash * 23 + (Revision == null ? 0 : Revision.GetHashCode()); hash = hash * 23 + (Rowguid == default(Guid) ? 0 : Rowguid.GetHashCode()); hash = hash * 23 + (Status == default(byte) ? 0 : Status.GetHashCode()); hash = hash * 23 + (Title == null ? 0 : Title.GetHashCode()); return(hash); } }