Inheritance: System.Net.WebRequest
 /// <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;
 }
Beispiel #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);
        }
Beispiel #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;
 }
 /// <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;
 }