CrazyStuff.Expressions.MethodCallInfo.GetHashCode C# (CSharp) Method

GetHashCode() public method

public GetHashCode ( ) : int
return int
        public override int GetHashCode()
        {
            unchecked
            {
                var arrayComparer = StructuralComparisons.StructuralEqualityComparer;
                return MethodName.GetHashCode()*397 ^ arrayComparer.GetHashCode(Arguments);
            }
        }

Usage Example

        public void Test_Two_Objects_With_The_Same_Arguments_Returns_The_Same_HashCode()
        {
            // Arrange
            var callInfo1 = new MethodCallInfo("Foo", new object[] {1, "foo", 2.0});
            var callInfo2 = new MethodCallInfo("Foo", new object[] {1, "foo", 2.0});

            // Assert
            Assert.AreEqual(callInfo1.GetHashCode(), callInfo2.GetHashCode());
        }