コード例 #1
0
 public RequestCreation(System.Uri uri, HttpMethod method, IClientHttpRequestFactory delegateRequestFactory, IEnumerable<IClientHttpRequestInterceptor> interceptors)
 {
     this.uri = uri;
     this.method = method;
     this.delegateRequestFactory = delegateRequestFactory;
     this.enumerator = interceptors.GetEnumerator();
 }
        public void SetUp()
        {
            requestFactory = this.CreateRequestFactory();

            webServiceHost = new WebServiceHost(typeof(TestService), new Uri(BASE_URL));
            this.ConfigureWebServiceHost(webServiceHost);
            webServiceHost.Open();
        }
        public void SetUp()
        {
            requestFactory = this.CreateRequestFactory();

            webServiceHost = new WebServiceHost(typeof(TestService), new Uri(BASE_URL));
            this.ConfigureWebServiceHost(webServiceHost);
            webServiceHost.Open();
        }
 public RequestCreation(Uri uri, HttpMethod method,
                        IClientHttpRequestFactory delegateRequestFactory,
                        IEnumerable <IClientHttpRequestInterceptor> interceptors)
 {
     this.uri    = uri;
     this.method = method;
     this.delegateRequestFactory = delegateRequestFactory;
     this.enumerator             = interceptors.GetEnumerator();
 }
        /// <summary>
        /// Creates a new instance of the <see cref="InterceptingClientHttpRequestFactory"/> with the given parameters.
        /// </summary>
        /// <param name="requestFactory">The request factory to wrap.</param>
        /// <param name="interceptors">The interceptors that are to be applied. Can be <c>null</c>.</param>
        public InterceptingClientHttpRequestFactory(
            IClientHttpRequestFactory requestFactory,
            IEnumerable <IClientHttpRequestInterceptor> interceptors)
        {
            ArgumentUtils.AssertNotNull(requestFactory, "requestFactory");

            this.targetRequestFactory = requestFactory;
            this.interceptors         = interceptors != null ? interceptors : new IClientHttpRequestInterceptor[0];
        }
コード例 #6
0
        /// <summary>
        /// Creates a new instance of the <see cref="InterceptingClientHttpRequestFactory"/> with the given parameters.
        /// </summary>
        /// <param name="requestFactory">The request factory to wrap.</param>
        /// <param name="interceptors">The interceptors that are to be applied. Can be <c>null</c>.</param>
        public InterceptingClientHttpRequestFactory(
            IClientHttpRequestFactory requestFactory,
            IEnumerable<IClientHttpRequestInterceptor> interceptors)
        {
            ArgumentUtils.AssertNotNull(requestFactory, "requestFactory");

            this.targetRequestFactory = requestFactory;
            this.interceptors = interceptors != null ? interceptors : new IClientHttpRequestInterceptor[0];
        }
コード例 #7
0
	    public void SetUp() 
        {
            mocks = new MockRepository();
            requestFactory = mocks.StrictMock<IClientHttpRequestFactory>();
            request = mocks.StrictMock<IClientHttpRequest>();
            response = mocks.StrictMock<IClientHttpResponse>();
            errorHandler = mocks.StrictMock<IResponseErrorHandler>();
            converter = mocks.StrictMock<IHttpMessageConverter>();
            
            IList<IHttpMessageConverter> messageConverters = new List<IHttpMessageConverter>(1);
            messageConverters.Add(converter);

            template = new RestTemplate();
            template.RequestFactory = requestFactory;
            template.MessageConverters = messageConverters;
            template.ErrorHandler = errorHandler;
	    }
コード例 #8
0
        public void SetUp()
        {
            mocks          = new MockRepository();
            requestFactory = mocks.StrictMock <IClientHttpRequestFactory>();
            request        = mocks.StrictMock <IClientHttpRequest>();
            response       = mocks.StrictMock <IClientHttpResponse>();
            errorHandler   = mocks.StrictMock <IResponseErrorHandler>();
            converter      = mocks.StrictMock <IHttpMessageConverter>();

            IList <IHttpMessageConverter> messageConverters = new List <IHttpMessageConverter>(1);

            messageConverters.Add(converter);

            template = new RestTemplate();
            template.RequestFactory    = requestFactory;
            template.MessageConverters = messageConverters;
            template.ErrorHandler      = errorHandler;
        }