public ConfiguredCall SetResultForLastCall(IReturn valueToReturn, MatchArgs matchArgs) { var spec = _getCallSpec.FromLastCall(matchArgs); CheckResultIsCompatibleWithCall(valueToReturn, spec); _configuredResults.SetResult(spec, valueToReturn); return(new ConfiguredCall(action => _callActions.Add(spec, action))); }
private object GetResultValueUsingProvider(ICall call, Type type, IAutoValueProvider provider) { var valueToReturn = provider.GetValue(type); if (_autoValueBehaviour == AutoValueBehaviour.UseValueForSubsequentCalls) { var spec = _callSpecificationFactory.CreateFrom(call, MatchArgs.AsSpecifiedInCall); _callResults.SetResult(spec, new ReturnValue(valueToReturn)); } return(valueToReturn); }
public void SetResultForCall(ICall call, IReturn valueToReturn, MatchArgs matchArgs) { var callSpecification = _callSpecificationFactory.CreateFrom(call, matchArgs); _configuredResults.SetResult(callSpecification, valueToReturn); }