You've already forked linux-packaging-mono
Imported Upstream version 5.12.0.220
Former-commit-id: c477e03582759447177c6d4bf412cd2355aad476
This commit is contained in:
parent
8bd104cef2
commit
8fc30896db
@@ -23,25 +23,6 @@ namespace MonoTests.System.Net
|
||||
[TestFixture]
|
||||
public class WebClientTest
|
||||
{
|
||||
private string _tempFolder;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp ()
|
||||
{
|
||||
_tempFolder = Path.Combine (Path.GetTempPath (),
|
||||
GetType ().FullName);
|
||||
if (Directory.Exists (_tempFolder))
|
||||
Directory.Delete (_tempFolder, true);
|
||||
Directory.CreateDirectory (_tempFolder);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown ()
|
||||
{
|
||||
if (Directory.Exists (_tempFolder))
|
||||
Directory.Delete (_tempFolder, true);
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
[ExpectedException (typeof (WebException))] // Something catches the PlatformNotSupportedException and re-throws an WebException
|
||||
@@ -842,8 +823,7 @@ namespace MonoTests.System.Net
|
||||
[Test] // UploadFile (string, string)
|
||||
public void UploadFile1_Address_Null ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
File.Create (tempFile).Close ();
|
||||
string tempFile = Path.GetTempFileName ();
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -855,14 +835,16 @@ namespace MonoTests.System.Net
|
||||
Assert.IsNotNull (ex.Message, "#4");
|
||||
Assert.IsNotNull (ex.ParamName, "#5");
|
||||
Assert.AreEqual ("address", ex.ParamName, "#6");
|
||||
} finally {
|
||||
if (File.Exists (tempFile))
|
||||
File.Delete (tempFile);
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // UploadFile (string, string)
|
||||
public void UploadFile1_Address_SchemeNotSupported ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
File.Create (tempFile).Close ();
|
||||
string tempFile = Path.GetTempFileName ();
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -882,13 +864,17 @@ namespace MonoTests.System.Net
|
||||
Assert.AreEqual (typeof (NotSupportedException), inner.GetType (), "#7");
|
||||
Assert.IsNull (inner.InnerException, "#8");
|
||||
Assert.IsNotNull (inner.Message, "#9");
|
||||
} finally {
|
||||
if (File.Exists (tempFile))
|
||||
File.Delete (tempFile);
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // UploadFile (string, string)
|
||||
public void UploadFile1_FileName_NotFound ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
var tempPath = Path.GetTempPath ();
|
||||
string tempFile = Path.Combine (tempPath, Path.GetRandomFileName ());
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -934,7 +920,7 @@ namespace MonoTests.System.Net
|
||||
[Test] // UploadFile (Uri, string)
|
||||
public void UploadFile2_Address_Null ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
string tempFile = Path.GetRandomFileName ();
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -952,8 +938,7 @@ namespace MonoTests.System.Net
|
||||
[Test] // UploadFile (Uri, string)
|
||||
public void UploadFile2_Address_SchemeNotSupported ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
File.Create (tempFile).Close ();
|
||||
string tempFile = Path.GetTempFileName ();
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -973,13 +958,17 @@ namespace MonoTests.System.Net
|
||||
Assert.AreEqual (typeof (NotSupportedException), inner.GetType (), "#7");
|
||||
Assert.IsNull (inner.InnerException, "#8");
|
||||
Assert.IsNotNull (inner.Message, "#9");
|
||||
} finally {
|
||||
if (File.Exists (tempFile))
|
||||
File.Delete (tempFile);
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // UploadFile (Uri, string)
|
||||
public void UploadFile2_FileName_NotFound ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
var tempPath = Path.GetTempPath ();
|
||||
string tempFile = Path.Combine (tempPath, Path.GetRandomFileName ());
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -1025,8 +1014,7 @@ namespace MonoTests.System.Net
|
||||
[Test] // UploadFile (string, string, string)
|
||||
public void UploadFile3_Address_Null ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
File.Create (tempFile).Close ();
|
||||
string tempFile = Path.GetRandomFileName ();
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -1037,15 +1025,14 @@ namespace MonoTests.System.Net
|
||||
Assert.IsNull (ex.InnerException, "#3");
|
||||
Assert.IsNotNull (ex.Message, "#4");
|
||||
Assert.IsNotNull (ex.ParamName, "#5");
|
||||
Assert.AreEqual ("path", ex.ParamName, "#6");
|
||||
Assert.AreEqual ("address", ex.ParamName, "#6");
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // UploadFile (string, string, string)
|
||||
public void UploadFile3_Address_SchemeNotSupported ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
File.Create (tempFile).Close ();
|
||||
string tempFile = Path.GetTempFileName ();
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -1065,13 +1052,17 @@ namespace MonoTests.System.Net
|
||||
Assert.AreEqual (typeof (NotSupportedException), inner.GetType (), "#7");
|
||||
Assert.IsNull (inner.InnerException, "#8");
|
||||
Assert.IsNotNull (inner.Message, "#9");
|
||||
} finally {
|
||||
if (File.Exists (tempFile))
|
||||
File.Delete (tempFile);
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // UploadFile (string, string, string)
|
||||
public void UploadFile3_FileName_NotFound ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
var tempPath = Path.GetTempPath ();
|
||||
string tempFile = Path.Combine (tempPath, Path.GetRandomFileName ());
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -1117,7 +1108,7 @@ namespace MonoTests.System.Net
|
||||
[Test] // UploadFile (Uri, string, string)
|
||||
public void UploadFile4_Address_Null ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
string tempFile = Path.GetRandomFileName ();
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -1135,8 +1126,7 @@ namespace MonoTests.System.Net
|
||||
[Test] // UploadFile (Uri, string, string)
|
||||
public void UploadFile4_Address_SchemeNotSupported ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
File.Create (tempFile).Close ();
|
||||
string tempFile = Path.GetTempFileName ();
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -1156,13 +1146,17 @@ namespace MonoTests.System.Net
|
||||
Assert.AreEqual (typeof (NotSupportedException), inner.GetType (), "#7");
|
||||
Assert.IsNull (inner.InnerException, "#8");
|
||||
Assert.IsNotNull (inner.Message, "#9");
|
||||
} finally {
|
||||
if (File.Exists (tempFile))
|
||||
File.Delete (tempFile);
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // UploadFile (Uri, string, string)
|
||||
public void UploadFile4_FileName_NotFound ()
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
var tempPath = Path.GetTempPath ();
|
||||
string tempFile = Path.Combine (tempPath, Path.GetRandomFileName ());
|
||||
|
||||
WebClient wc = new WebClient ();
|
||||
try {
|
||||
@@ -1691,6 +1685,7 @@ namespace MonoTests.System.Net
|
||||
// We throw a PlatformNotSupportedException deeper, which is caught and re-thrown as WebException
|
||||
[ExpectedException (typeof (WebException))]
|
||||
#endif
|
||||
[Category ("MobileNotWorking")] // https://github.com/xamarin/xamarin-macios/issues/3827
|
||||
[Category ("InetAccess")]
|
||||
public void GetWebRequestOverriding ()
|
||||
{
|
||||
@@ -1874,8 +1869,7 @@ namespace MonoTests.System.Net
|
||||
{
|
||||
UploadAsyncCancelEventTest (9304,(webClient, uri, cancelEvent) =>
|
||||
{
|
||||
string tempFile = Path.Combine (_tempFolder, "upload.tmp");
|
||||
File.Create (tempFile).Close ();
|
||||
string tempFile = Path.GetTempFileName ();
|
||||
|
||||
webClient.UploadFileCompleted += (sender, args) =>
|
||||
{
|
||||
|
Reference in New Issue
Block a user