Exemplo n.º 1
0
        public void GetHashCode_MultipleCallsOnSameObject_ShouldBeEqual()
        {
            var testValue = new FirstEnum(TestEnum.Value.First);

            var result1 = testValue.GetHashCode();
            var result2 = testValue.GetHashCode();

            Assert.AreEqual(result1, result2);
        }
Exemplo n.º 2
0
        public void GetHashCode_ForSameTypeAndDifferentValue_ShouldNotBeEqual()
        {
            var testValue1 = new FirstEnum(TestEnum.Value.Unknown);
            var testValue2 = new FirstEnum(TestEnum.Value.First);

            var result1 = testValue1.GetHashCode();
            var result2 = testValue2.GetHashCode();

            Assert.AreNotEqual(result1, result2);
        }
Exemplo n.º 3
0
        public void GetHashCode_ForDifferentTypeAndDifferentValue_ShouldNotBeEqual()
        {
            var testValue1 = new FirstEnum(TestEnum.Value.First);
            var testValue2 = new CombinedEnum(TestEnum.Value.Second);

            var result1 = testValue1.GetHashCode();
            var result2 = testValue2.GetHashCode();

            Assert.AreNotEqual(result1, result2);
        }
Exemplo n.º 4
0
        public void GetHashCode_ForSameTypeAndSameValue_ShouldBeEqual()
        {
            var testValue1 = new FirstEnum(TestEnum.Value.First);
            var testValue2 = new FirstEnum(TestEnum.Value.First);

            var result1 = testValue1.GetHashCode();
            var result2 = testValue2.GetHashCode();

            Assert.AreEqual(result1, result2);
        }