Exemplo n.º 1
0
        /// <summary>
        /// Retrieves an HttpImposter along with information about requests made to that
        /// imposter if mountebank is running with the "--mock" flag.
        /// </summary>
        /// <param name="port">The port number of the imposter to retrieve</param>
        /// <returns>The retrieved imposter</returns>
        /// <exception cref="MbDotNet.Exceptions.ImposterNotFoundException">Thrown if no imposter was found on the specified port.</exception>
        /// <exception cref="MbDotNet.Exceptions.InvalidProtocolException">Thrown if the retrieved imposter was not an HTTP imposter</exception>
        public RetrievedHttpImposter GetHttpImposter(int port)
        {
            var imposter = _requestProxy.GetHttpImposter(port);

            ValidateRetrievedImposterProtocol(imposter, Protocol.Http);

            return(imposter);
        }