+
+ using (WebClient m_WebClient = new WebClient())
+ {
+ string uri = String.Format ("ftp://{0}:{1}/uploads/file.txt", EncloseIPv6 (sp.IPAddress), sp.Port);
+
+ m_WebClient.UploadFile(uri, _tempFile);
+ }
+ Assert.AreEqual (10, sp.result.Count, "WebClient/Ftp#01");
+
+ sp.Stop ();
+ }
+
+ [Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+ public void DownloadFile1_v4 ()
+ {
+ DownloadFile (new ServerDownload (false));
+ }
+
+ [Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+ public void DownloadFile1_v6 ()
+ {
+ if (!Socket.OSSupportsIPv6)
+ Assert.Ignore ("IPv6 not supported.");
+
+ DownloadFile (new ServerDownload (true));
+ }
+
+ [Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+ public void DownloadFileNonLatinChars ()
+ {
+ string filename = "\u0411\u0430\u0448\u043DRowan-\u041F\u0435\u0441\u043D\u043F\u0440\u043E\u043C\u043E\u043D\u0430\u0445\u0430\u0422\u0435\u043E\u0434\u043E\u0440\u0443\u0441\u0430\u0438\u0437\u0413\u0430\u043C\u043C\u0435\u043B\u044C\u043D\u0430.mp3";
+ DownloadFile (new ServerDownload (null, null, filename, false), "ftp://{0}:{1}/" + filename);
+ }
+
+ void DownloadFile (ServerDownload sp, string uriTemplate = "ftp://{0}:{1}/file.txt")
+ {
+ sp.Start ();
+ string uri = String.Format (uriTemplate, EncloseIPv6 (sp.IPAddress), sp.Port);