Esempio n. 1
0
        /// <summary>
        /// Submits all pending imposters from the supplied collection to be created in mountebank.
        /// <exception cref="MbDotNet.Exceptions.MountebankException">Thrown if unable to create the imposter.</exception>
        /// </summary>
        public async Task SubmitAsync(ICollection <Imposter> imposters)
        {
            foreach (var imposter in imposters)
            {
                await _requestProxy.CreateImposterAsync(imposter).ConfigureAwait(false);

                Imposters.Add(imposter);
            }
        }
        /// <summary>
        /// Submits all pending imposters from the supplied collection to be created in mountebank.
        /// <exception cref="MbDotNet.Exceptions.MountebankException">Thrown if unable to create the imposter.</exception>
        /// </summary>
        public async Task SubmitAsync(ICollection <Imposter> imposters, CancellationToken cancellationToken = default)
        {
            foreach (var imposter in imposters)
            {
                await _requestProxy.CreateImposterAsync(imposter, cancellationToken).ConfigureAwait(false);

                Imposters.Add(imposter);
            }
        }