private MethodCallResult CreateMethodCallResult(FakeObjectCall fakeObjectCall) { var result = new MethodCallResult(this.ResolveReturnValue(fakeObjectCall)); this.AddOutAndRefValues(result, fakeObjectCall); return(result); }
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); } } }
public void Put(MethodCall methodCall, MethodCallResult methodCallResult) { this.cachedResults[methodCall] = methodCallResult; }