Exemple #1
0
        public PendingSpecificationInfo UseCallSpecInfo()
        {
            var result = _impl.UseCallSpecInfo();

            Trace($"UseCallSpecInfo() => {result.DiagName(_ctx)}");
            return(result);
        }
        public ICallSpecification FromPendingSpecification(MatchArgs matchArgs)
        {
            if (!_pendingSpecification.HasPendingCallSpecInfo())
            {
                throw new InvalidOperationException("No pending specification or previous call info.");
            }

            var pendingSpecInfo = _pendingSpecification.UseCallSpecInfo();

            return(pendingSpecInfo.Handle(
                       callSpec => FromExistingSpec(callSpec, matchArgs),
                       lastCall =>
            {
                _callCollection.Delete(lastCall);
                return FromCall(lastCall, matchArgs);
            }));
        }