public void GetHashCode_DifferentValues_DifferentHash() { // Arrange var fooA = new TestSettings1 { IntProperty = 123, StringPropert = "ms" }; var fooB = new TestSettings1 { IntProperty = 321, StringPropert = "sdfe" }; // Act var hashA = fooA.GetHashCode(); var hashB = fooB.GetHashCode(); // Assert Assert.AreNotEqual(hashA, hashB); }
public void GetHashCode_DifferentClasses_DifferentHash() { // Arrange var intValue = 317; var strValue = "s"; var fooA = new TestSettings1 { IntProperty = intValue, StringPropert = strValue }; var fooB = new TestSettings2 { IntProperty = intValue, StringPropert = strValue }; // Act var hashA = fooA.GetHashCode(); var hashB = fooB.GetHashCode(); // Assert Assert.AreNotEqual(hashA, hashB); }