Inheritance: System.Net.WebRequest
Ejemplo n.º 1
0
 /// <summary></summary>
 /// <param name="schema">
 /// The URL schema to inject into the <see cref="WebRequest"/> factory. URLs
 /// with the specified schema will be handled by this <see cref="TestWebRequest"/>
 /// </param>
 /// <seealso cref="TestWebRequestCreate.CreateTestRequest"/>
 public FakeHttpHelper(string schema, string responseText)
     : this()
 {
     WebRequest.RegisterPrefix(schema, new TestWebRequestCreate());
     _testRequest = TestWebRequestCreate.CreateTestRequest(responseText);
     ResponseText = responseText;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Utility method for creating a TestWebRequest and setting
        /// it to be the next WebRequest to use.
        /// </summary>
        /// <param name="response">The response the TestWebRequest will return.</param>
        public static TestWebRequest CreateTestRequest(string response)
        {
            TestWebRequest request = new TestWebRequest(response);

            NextRequest = request;
            return(request);
        }
Ejemplo n.º 3
0
 /// <summary></summary>
 /// <param name="schema">
 /// The URL schema to inject into the <see cref="WebRequest"/> factory. URLs
 /// with the specified schema will be handled by this <see cref="TestWebRequest"/>
 /// </param>
 /// <seealso cref="TestWebRequestCreate.CreateTestRequest"/>
 public FakeHttpHelper(string schema, string responseText) : this()
 {
     WebRequest.RegisterPrefix(schema, new TestWebRequestCreate());
     _testRequest = TestWebRequestCreate.CreateTestRequest(responseText);
     ResponseText = responseText;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Utility method for creating a TestWebRequest and setting
 /// it to be the next WebRequest to use.
 /// </summary>
 /// <param name="response">The response the TestWebRequest will return.</param>
 public static TestWebRequest CreateTestRequest(string response)
 {
     TestWebRequest request = new TestWebRequest(response);
     NextRequest = request;
     return request;
 }