本文整理汇总了C#中ICall.GetArgumentSpecifications方法的典型用法代码示例。如果您正苦于以下问题:C# ICall.GetArgumentSpecifications方法的具体用法?C# ICall.GetArgumentSpecifications怎么用?C# ICall.GetArgumentSpecifications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICall
的用法示例。
在下文中一共展示了ICall.GetArgumentSpecifications方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateFrom
public ICallSpecification CreateFrom(ICall call, MatchArgs matchArgs)
{
var methodInfo = call.GetMethodInfo();
var argumentSpecs = call.GetArgumentSpecifications();
var arguments = call.GetOriginalArguments();
var parameterInfos = call.GetParameterInfos();
var argumentSpecificationsForCall = _argumentSpecificationsFactory.Create(argumentSpecs, arguments, parameterInfos, matchArgs);
return new CallSpecification(methodInfo, argumentSpecificationsForCall);
}
示例2: CreateCallToPropertyGetterFromSetterCall
public ICall CreateCallToPropertyGetterFromSetterCall(ICall callToSetter)
{
var propertyInfo = GetPropertyFromSetterCallOrNull(callToSetter);
if (!PropertySetterExistsAndHasAGetMethod(propertyInfo))
{
throw new InvalidOperationException("Could not find a GetMethod for \"" + callToSetter.GetMethodInfo() + "\"");
}
var setterArgs = callToSetter.GetArguments();
var getter = propertyInfo.GetGetMethod();
var getterArgs = setterArgs.Take(setterArgs.Length - 1).ToArray();
return new Call(getter, getterArgs, callToSetter.Target(), callToSetter.GetArgumentSpecifications());
}
示例3: IsSpecifyingACall
private bool IsSpecifyingACall(ICall call)
{
var args = call.GetArguments() ?? EmptyArgs;
var argSpecs = call.GetArgumentSpecifications() ?? EmptyArgSpecs;
return _isSetToDefaultRoute && args.Any() && argSpecs.Any();
}