예제 #1
0
        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());
        }
예제 #2
0
        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);
        }
예제 #3
0
        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());
        }