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


C# ICall类代码示例

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


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

示例1: Handle

 public RouteAction Handle(ICall call)
 {
     var callSpecification = _callSpecificationFactory.CreateFrom(call, _matchArgs);
     if (!_receivedCalls.FindMatchingCalls(callSpecification).Any())
     {
         _exceptionThrower.Throw(callSpecification, GetAllReceivedCallsToMethod(call));
     }
     return RouteAction.Continue();
 }
开发者ID:rodrigoelp,项目名称:NSubstitute,代码行数:9,代码来源:CheckReceivedCallHandler.cs

示例2: 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

示例3: action

        RouteAction ICallHandler.Handle(ICall call)
        {
            if (!HasResultFor(call))
                action();

            return RouteAction.Continue();
        }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:7,代码来源:NoSetupCallbackHandler.cs

示例4: NonMatchingArguments

 public IEnumerable<ArgumentMatchInfo> NonMatchingArguments(ICall call)
 {
     var arguments = call.GetArguments();
     return arguments
             .Select((arg, index) => new ArgumentMatchInfo(index, arg, _argumentSpecifications[index]))
             .Where(x => !x.IsMatch);
 }
开发者ID:tanujmathur,项目名称:NSubstitute,代码行数:7,代码来源:CallSpecification.cs

示例5: HandleCall

 private ICode HandleCall(ICall call, Func<Expr, IEnumerable<Expr>, ICode> fnNew) {
     if (call.CallMethod.Name == "DeepCopyValueType") {
         // HACK
         return call;
     }
     var obj = (Expr)this.Visit(call.Obj);
     var argsInfo = call.Args.Select((arg, i) => new { arg, parameterType = call.CallMethod.Parameters[i].ParameterType }).ToArray();
     var args = this.HandleList(argsInfo, argInfo => {
         if (!argInfo.parameterType.IsValueType) {
             return argInfo;
         }
         var arg = argInfo.arg;
         var type = arg.Type;
         if (type.IsNonPrimitiveValueType() && !type.IsRuntimeHandle() && !type.IsEnum()) {
             return new { arg = InternalFunctions.ValueTypeDeepCopyIfRequired(arg.Type, () => arg) ?? arg, parameterType = argInfo.parameterType };
         } else {
             return argInfo;
         }
     }).NullThru(x => x.Select(y => y.arg).ToArray());
     if (obj != call.Obj || args != null) {
         return fnNew(obj, args ?? call.Args);
     } else {
         return call;
     }
 }
开发者ID:chrisdunelm,项目名称:DotNetWebToolkit,代码行数:25,代码来源:VisitorJsResolveValueTypes.cs

示例6: IsSatisfiedBy

 public bool IsSatisfiedBy(ICall call)
 {
     if (_methodInfo != call.GetMethodInfo()) return false;
     if (HasDifferentNumberOfArguments(call)) return false;
     if (NonMatchingArguments(call).Any()) return false;
     return true;
 }
开发者ID:tanujmathur,项目名称:NSubstitute,代码行数:7,代码来源:CallSpecification.cs

示例7: GetResult

 public object GetResult(ICall call)
 {
     return _results
             .Reverse()
             .First(x => x.IsResultFor(call))
             .GetResult(_callInfoFactory.Create(call));
 }
开发者ID:nsubstitute,项目名称:NSubstitute,代码行数:7,代码来源:ResultsForType.cs

示例8: IsTriggered

		public bool IsTriggered(ICall call, DateTime triggerDate)
		{
			if( new TimeSpan(triggerDate.Ticks - call.Date.Ticks).TotalMilliseconds >= _delay)
				return true;
			
			return false;
		}
开发者ID:deveck,项目名称:Deveck.TAM,代码行数:7,代码来源:RingDelay.cs

示例9: Handle

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

示例10: op_Equality

 public static Expr op_Equality(ICall call) {
     var ctx = call.Ctx;
     var a = call.Args.ElementAt(0);
     var b = call.Args.ElementAt(1);
     var expr = new ExprBinary(ctx, BinaryOp.Equal, ctx.Boolean, a, b);
     return expr;
 }
开发者ID:chrisdunelm,项目名称:DotNetWebToolkit,代码行数:7,代码来源:_Type.cs

示例11: Expect

		public void Expect( ICall call )
		{
			if ( expectedCalls == null )
				expectedCalls = new ArrayList();

			expectedCalls.Add( call );
		}
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:7,代码来源:MockMethod.cs

示例12: TriggeredExecution

		public bool TriggeredExecution(ICall call)
		{
			foreach(ITrigger trigger in _triggers)
			{
				if(!trigger.IsTriggered(call, DateTime.Now))
					return false;
			}
			
			_log.Info("Actionpack '{0}' is triggered for call '{1}'", _name, call);
			
			foreach(IAction action in _actions)
			{
				try
				{
					_log.Info("started action '{0}'", action.GetType());
					action.Execute(call);
					_log.Info("Completed action '{0}'", action.GetType());
				}
				catch(Exception e)
				{
					_log.ErrorException(string.Format("Error executing action '{0}'",action.GetType()), e);
				}
			}
			
			return true;
		}
开发者ID:deveck,项目名称:Deveck.TAM,代码行数:26,代码来源:ActionPack.cs

示例13: OnFailure

 public void OnFailure(ICall call, Java.IO.IOException exception)
 {
     if (onFailure != null)
     {
         onFailure(call, exception);
     }
 }
开发者ID:Redth,项目名称:square-bindings,代码行数:7,代码来源:Call.cs

示例14: OnResponse

 public void OnResponse(ICall call, Response response)
 {
     if (onResponse != null)
     {
         onResponse(call, response);
     }
 }
开发者ID:Redth,项目名称:square-bindings,代码行数:7,代码来源:Call.cs

示例15: InvokeMatchingActions

 public void InvokeMatchingActions(ICall call)
 {
     var callInfo = _callInfoFactory.Create(call);
     foreach (var action in _actions.Where(x => x.IsSatisfiedBy(call)))
     {
         action.Invoke(callInfo);
     }
 }
开发者ID:deatharthas,项目名称:NSubstitute,代码行数:8,代码来源:CallActions.cs


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