Example #1
0
        public void Deve_ter_hashcode_diferente_se_valor_diferente()
        {
            var vo1 = new ObjetoValor("Nam", 11);
            var vo2 = new ObjetoValor("Name", 10);

            Assert.AreNotEqual(vo1.GetHashCode(), vo2.GetHashCode());
            Assert.IsTrue(vo1.GetHashCode() != vo2.GetHashCode());
        }
Example #2
0
        public void Deve_ter_hashcode_igual()
        {
            var vo1 = new ObjetoValor("Name", 10);
            var vo2 = new ObjetoValor("Name", 10);

            Assert.AreEqual(vo1.GetHashCode(), vo2.GetHashCode());
            Assert.IsTrue(vo1.GetHashCode() == vo2.GetHashCode());
            Assert.IsTrue(vo1.GetHashCode().Equals(vo2.GetHashCode()));
        }