Beispiel #1
0
        IHttpWebResponse IHttpWebRequest.GetResponse()
        {
            var response = new MockHttpWebResponse();
            response.CharacterSet = CharacterSet;
            response.ResponseHtml = ResponseHtml;
            if (!String.IsNullOrEmpty(CharacterSet))
            {
                response.AddHeader(HttpResponseHeader.ContentType, "text/html;charset=" + CharacterSet);
            }

            return response;
        }
        private IHttpWebResponse GetResponse()
        {
            var response = new MockHttpWebResponse();
            response.CharacterSet = CharacterSet;
            response.ResponseStream = ResponseStream;

            if (!String.IsNullOrEmpty(CharacterSet))
            {
                response.AddHeader(HttpResponseHeader.ContentType, "text/html;charset=" + CharacterSet);
            }

            if (ResponseTime > Timeout)
            {
                 throw new WebException("The response was not receved within " + Timeout + " milliseconds.",WebExceptionStatus.Timeout);
            }

            return response;
        }
        private IHttpWebResponse GetResponse()
        {
            var response = new MockHttpWebResponse();

            response.CharacterSet   = CharacterSet;
            response.ResponseStream = ResponseStream;

            if (!String.IsNullOrEmpty(CharacterSet))
            {
                response.AddHeader(HttpResponseHeader.ContentType, "text/html;charset=" + CharacterSet);
            }

            if (ResponseTime > Timeout)
            {
                throw new WebException("The response was not receved within " + Timeout + " milliseconds.", WebExceptionStatus.Timeout);
            }

            return(response);
        }