Beispiel #1
0
 public void CreateHTTPWebRequestTest()
 {
     IWebRequestCreate create = new PrefixWebRequestCreater();
     var webRequest = create.Create(new Uri("http://127.0.0.1"));
     Assert.IsTrue(webRequest is HttpWebRequest, "当前请求不是个HTTP的请求");
     var webResponse = webRequest.GetResponse();
     Assert.IsTrue(webResponse is HttpWebRequest.HttpWebResponse, "当前FTP请求返回类非HTT响应");
 }
Beispiel #2
0
 public void CreateFtpWebRequestTest()
 {
     IWebRequestCreate create = new PrefixWebRequestCreater();
     var webRequest = create.Create(new Uri("ftp://127.0.0.1"));
     Assert.IsTrue(webRequest is FtpWebRequest, "当前请求不是个ftp的请求");
     var webResponse = webRequest.GetResponse();
     Assert.IsTrue(webResponse is FtpWebRequest.FtpWebResponse, "当前FTP请求返回类非ftp响应");
 }