public void HashCodeEqualsTest() { var chatLink = new BuildChatLink { Profession = ProfessionType.Warrior, Specialization1Id = 123, Specialization2Id = 234, Specialization3Id = 14 }; var chatLink2 = new BuildChatLink { Profession = ProfessionType.Warrior, Specialization1Id = 123, Specialization2Id = 234, Specialization3Id = 14 }; Assert.Equal(chatLink.GetHashCode(), chatLink2.GetHashCode()); }
public void HashCodeNotEqualsTest() { var chatLink = new BuildChatLink { Profession = ProfessionType.Warrior, Specialization1Id = 123, Specialization2Id = 234, Specialization3Id = 14 }; var chatLink2 = new BuildChatLink { Profession = ProfessionType.Guardian, Specialization1Id = 123, Specialization2Id = 234, Specialization3Id = 14 }; var chatLink3 = new BuildChatLink { Profession = ProfessionType.Warrior, Specialization1Id = 222, Specialization2Id = 100, Specialization3Id = 14 }; var chatLink4 = new BuildChatLink { Profession = ProfessionType.Warrior, Specialization1Id = 123, Specialization2Id = 234, Specialization3Id = 147 }; Assert.NotEqual(chatLink.GetHashCode(), chatLink2.GetHashCode()); Assert.NotEqual(chatLink.GetHashCode(), chatLink3.GetHashCode()); Assert.NotEqual(chatLink.GetHashCode(), chatLink4.GetHashCode()); Assert.NotEqual(chatLink2.GetHashCode(), chatLink3.GetHashCode()); Assert.NotEqual(chatLink2.GetHashCode(), chatLink4.GetHashCode()); Assert.NotEqual(chatLink3.GetHashCode(), chatLink4.GetHashCode()); }