示例#1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="MethodMatcher"/> class.
		/// </summary>
		/// <param name="methodInfo">The expected method reference.</param>
		public MethodMatcher(MethodInfo methodInfo)
			: base(methodInfo.Name, methodInfo.DeclaringType)
		{
			if (methodInfo == null) throw new ArgumentNullException("methodInfo");

			_methodInfo = methodInfo;
			_genericParametersMatcher = new GenericMethodTypeParametersMatcher(_methodInfo.GetGenericArguments());
			_expectedParameters = _methodInfo.GetParameters();
		}
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MethodMatcher"/> class.
        /// </summary>
        /// <param name="methodInfo">The expected method reference.</param>
        public MethodMatcher(MethodInfo methodInfo)
            : base(methodInfo.Name, methodInfo.DeclaringType)
        {
            if (methodInfo == null)
            {
                throw new ArgumentNullException("methodInfo");
            }

            _methodInfo = methodInfo;
            _genericParametersMatcher = new GenericMethodTypeParametersMatcher(_methodInfo.GetGenericArguments());
            _expectedParameters       = _methodInfo.GetParameters();
        }