Пример #1
0
        /// <summary>
        /// Uses the given method to verify expectations for the method.
        /// </summary>
        /// <param name="mi">mathod called</param>
        /// <param name="args">arguments to the method</param>
        /// <returns>Return value, if any, from method call.</returns>
        public virtual object Call(MethodInfo mi, params object[] args)
        {
            MethodCall methodCall = new MethodCall(mi, args);
            string     methodName = methodCall.MethodName;

            if (values.Contains(methodName))
            {
                return(values[methodName]);
            }
            IMethodCallExpectation e = nextExpectation(methodCall);

            return(e.CheckCallAndSendResponse(methodCall));
        }