[TestFixture]
public class FtpWebRequestTest
{
- FtpWebRequest defaultRequest;
+ FtpWebRequest _defaultRequest;
+ FtpWebRequest defaultRequest {
+ get { return _defaultRequest ?? (_defaultRequest = (FtpWebRequest) WebRequest.Create ("ftp://www.contoso.com")); }
+ }
private string _tempDirectory;
private string _tempFile;
Directory.Delete (_tempDirectory, true);
}
- [TestFixtureSetUp]
- public void Init ()
- {
- defaultRequest = (FtpWebRequest) WebRequest.Create ("ftp://www.contoso.com");
- }
-
[Test]
public void ContentLength ()
{
try {
long l = defaultRequest.ContentLength;
+#if FEATURE_NO_BSD_SOCKETS
+ Assert.Fail ("#1a");
+ } catch (PlatformNotSupportedException) {
+ // OK.
+#else
} catch (NotSupportedException) {
Assert.Fail ("#1"); // Not overriden
+#endif
}
try {
defaultRequest.ContentLength = 2;
+#if FEATURE_NO_BSD_SOCKETS
+ Assert.Fail ("#2a");
+ } catch (PlatformNotSupportedException) {
+ // OK.
+#else
} catch (NotSupportedException) {
Assert.Fail ("#2"); // Not overriden
+#endif
}
}
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ContentOffset ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Credentials ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Method ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReadWriteTimeout ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Timeout ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DefaultValues ()
{
FtpWebRequest request = (FtpWebRequest) WebRequest.Create ("ftp://www.contoso.com");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void RenameTo ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UploadFile1 ()
{
ServerPut sp = new ServerPut ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UploadFile_WebClient ()
{
ServerPut sp = new ServerPut ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DownloadFile1 ()
{
DownloadFile (new ServerDownload ());
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DownloadFile2 ()
{
// Some embedded FTP servers in Industrial Automation Hardware report
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DeleteFile1 ()
{
ServerDeleteFile sp = new ServerDeleteFile ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ListDirectory1 ()
{
ServerListDirectory sp = new ServerListDirectory ();