예제 #1
0
        public void EquivalentTypeComparerTest4()
        {
            EquivalentTypeComparer equivalentTypeComparer = new EquivalentTypeComparer();

            Assert.AreNotEqual(
                equivalentTypeComparer.GetHashCode(typeof(string)),
                equivalentTypeComparer.GetHashCode(typeof(object)));
        }
예제 #2
0
        public void EquivalentTypeComparerTest2()
        {
            EquivalentTypeComparer equivalentTypeComparer = new EquivalentTypeComparer();

            Assert.AreEqual(
                equivalentTypeComparer.GetHashCode(methodInfoParameter.ReturnType),
                equivalentTypeComparer.GetHashCode(methodInfoParameter.GetParameterTypes().First()));
        }
예제 #3
0
        private static void CheckGetHashCode(Type x, Type y, bool shouldBeEqualHashCodes)
        {
            var comparer       = new EquivalentTypeComparer();
            var firstHashCode  = comparer.GetHashCode(x);
            var secondHashCode = comparer.GetHashCode(y);

            if (shouldBeEqualHashCodes)
            {
                firstHashCode.Should().Be(secondHashCode);
            }
        }