Exemplo n.º 1
0
        public RouteAction Handle(ICall call)
        {
            var callSpecification    = _callSpecificationFactory.CreateFrom(call, _matchArgs);
            var allCallsToMethodSpec = _callSpecificationFactory.CreateFrom(call, MatchArgs.Any);

            var allCalls      = _receivedCalls.AllCalls();
            var matchingCalls = allCalls.Where(x => callSpecification.IsSatisfiedBy(x));
            var relatedCalls  = allCalls.Where(x => allCallsToMethodSpec.IsSatisfiedBy(x)).Except(matchingCalls);

            if (!_requiredQuantity.Matches(matchingCalls))
            {
                _exceptionThrower.Throw(callSpecification, matchingCalls, relatedCalls, _requiredQuantity);
            }
            return(RouteAction.Continue());
        }
Exemplo n.º 2
0
 public IEnumerable <ICall> ReceivedCalls()
 {
     return(_receivedCalls.AllCalls());
 }