Пример #1
0
        public RouteAction Handle(ICall call)
        {
            var callSpec = _callSpecificationFactory.CreateFrom(call, _matchArgs);

            _callActions.Add(callSpec, _action);
            return(RouteAction.Continue());
        }
Пример #2
0
        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)));
        }
        public RouteAction Handle(ICall call)
        {
            var callSpec = _callSpecificationFactory.CreateFrom(call, MatchArgs.AsSpecifiedInCall);

            _pendingCallSpecification.SetCallSpecification(callSpec);
            _callActions.Add(callSpec);
            return(RouteAction.Continue());
        }
        public RouteAction Handle(ICall call)
        {
            var callSpec = _callSpecificationFactory.CreateFrom(call, MatchArgs.AsSpecifiedInCall);

            _pendingCallSpecification.SetCallSpecification(callSpec);

            // Performance optimization - don't register call actions if current argument matchers
            // don't have any callbacks.
            if (call.GetArgumentSpecifications().Any(x => x.HasAction))
            {
                _callActions.Add(callSpec);
            }

            return(RouteAction.Continue());
        }