public ICallSpecification CreateFrom(ICall call) { var result = new CallSpecification(call.GetMethodInfo()); var argumentSpecs = _context.DequeueAllArgumentSpecifications(); var arguments = call.GetArguments(); if (argumentSpecs.Count == 0) { AddArgumentSpecsToCallSpec(result, arguments.Select(x => (IArgumentSpecification) new ArgumentEqualsSpecification(x))); } else if (argumentSpecs.Count == arguments.Length) { AddArgumentSpecsToCallSpec(result, argumentSpecs); } else { throw new AmbiguousArgumentsException( "Cannot determine argument specifications to use. Please use specifications for all arguments."); } return result; }
public bool IsSatisfiedBy(ICall call) => CallSpecification.IsSatisfiedBy(call);