public void Transactional_Unit_GetHashCode_SameReferences() { String currentValue = "Current"; String originalValue = "Original"; Transactional<String> first = new Transactional<String>(currentValue, originalValue); Transactional<String> second = first; Assert.AreEqual(first.GetHashCode(), second.GetHashCode()); }
public void Transactional_Unit_GetHashCode_UnequivalentObjects() { String currentValue = "Current"; String originalValue = "Original"; Transactional<String> first = new Transactional<String>(currentValue, originalValue); Transactional<String> second = new Transactional<String>(currentValue); Int32 firstHash = first.GetHashCode(); Int32 secondHash = second.GetHashCode(); Assert.AreNotEqual(firstHash, secondHash); }
public void Transactional_Unit_GetHashCode_NullValues() { String currentValue = null; String originalValue = null; Transactional<String> first = new Transactional<String>(currentValue, originalValue); Transactional<String> second = new Transactional<String>(currentValue, originalValue); Assert.AreEqual(first.GetHashCode(), second.GetHashCode()); }