Example #1
0
        private MethodCallResult CreateMethodCallResult(FakeObjectCall fakeObjectCall)
        {
            var result = new MethodCallResult(this.ResolveReturnValue(fakeObjectCall));

            this.AddOutAndRefValues(result, fakeObjectCall);
            return(result);
        }
Example #2
0
        private void AddOutAndRefValues(MethodCallResult result, FakeObjectCall fakeObjectCall)
        {
            var parameters = fakeObjectCall.Method.GetParameters();

            for (int i = 0; i < parameters.Length; i++)
            {
                var parameterParameterType = parameters[i].ParameterType;
                if (parameterParameterType.IsByRef)
                {
                    var value = this.context.Resolve(parameterParameterType.GetElementType());
                    result.AddOutOrRefValue(i, value);
                }
            }
        }
Example #3
0
 public void Put(MethodCall methodCall, MethodCallResult methodCallResult)
 {
     this.cachedResults[methodCall] = methodCallResult;
 }