当前位置: 首页>>代码示例>>C#>>正文


C# ICall.Target方法代码示例

本文整理汇总了C#中ICall.Target方法的典型用法代码示例。如果您正苦于以下问题:C# ICall.Target方法的具体用法?C# ICall.Target怎么用?C# ICall.Target使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICall的用法示例。


在下文中一共展示了ICall.Target方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Handle

 public RouteAction Handle(ICall call)
 {
     var target = call.Target();
     var callSpec = _callSpecificationFactory.CreateFrom(call, MatchArgs.AsSpecifiedInCall);
     _context.AddToQuery(target, callSpec);
     return RouteAction.Continue();
 }
开发者ID:deatharthas,项目名称:NSubstitute,代码行数:7,代码来源:AddCallToQueryResultHandler.cs

示例2: FormatCall

        private string FormatCall(ICall call, bool isAcrossMultipleTargets, TypeInstanceNumberLookup instanceLookup)
        {
            var s = _callFormatter.Format(call.GetMethodInfo(), FormatArgs(call.GetArguments()));
            if (!isAcrossMultipleTargets) return s;

            var target = call.Target();
            var methodInfo = call.GetMethodInfo();
            return FormatCallForInstance(instanceLookup, target, methodInfo, s);
        }
开发者ID:robdmoore,项目名称:NSubstitute,代码行数:9,代码来源:SequenceInOrderAssertion.cs

示例3: 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 getter = propertyInfo.GetGetMethod();
     return new CallToPropertyGetter(getter, callToSetter.Target());
 }
开发者ID:troyhunt,项目名称:NSubstitute,代码行数:10,代码来源:PropertyHelper.cs

示例4: 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());
 }
开发者ID:deatharthas,项目名称:NSubstitute,代码行数:12,代码来源:PropertyHelper.cs

示例5: Matches

 private bool Matches(ICall call, CallSpecAndTarget specAndTarget)
 {
     return ReferenceEquals(call.Target(), specAndTarget.Target)
            && specAndTarget.CallSpecification.IsSatisfiedBy(call);
 }
开发者ID:JakeGinnivan,项目名称:NSubstitute,代码行数:5,代码来源:SequenceInOrderAssertion.cs


注:本文中的ICall.Target方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。