public void GetHashCode_DifferentProperties_DifferentHashCode() { // arrange var sut1 = new EntryCriteria { PageNumber = 2, PageSize = 10, Tag = "tag" }; var sut2 = new EntryCriteria { PageNumber = 2, PageSize = 10, Tag = "tag", Category = "cat" }; // act var hashcode1 = sut1.GetHashCode(); var hashcode2 = sut2.GetHashCode(); // assert Assert.That(hashcode1, Is.Not.EqualTo(hashcode2)); }
public void GetHashCode_NothingSet_ReturnsZero() { // arrange var sut = new EntryCriteria(); // act var hashcode = sut.GetHashCode(); // assert Assert.That(hashcode, Is.EqualTo(0)); }
public void GetHashCode_SameProperties_SameHashCode() { // arrange var sut1 = new EntryCriteria { PageNumber = 2, PageSize = 10, Tag = "tag" }; var sut2 = new EntryCriteria { PageNumber = 2, PageSize = 10, Tag = "tag" }; // act var hashcode1 = sut1.GetHashCode(); var hashcode2 = sut2.GetHashCode(); // assert Assert.That(hashcode1, Is.EqualTo(hashcode2)); }
public override int GetHashCode() { return(EntryCriteria.GetHashCode() + ResultOrder.GetHashCode()); }