Imported Upstream version 6.0.0.172

Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-12 14:10:50 +00:00
parent 8016999e4d
commit 64ac736ec5
32155 changed files with 3981439 additions and 75368 deletions

View File

@ -21,37 +21,29 @@ using System.Security.Permissions;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.Net
{
[TestFixture]
public class FileWebRequestTest
{
private string _tempDirectory;
private TempDirectory _tempDirectory;
private string _tempFile;
private Uri _tempFileUri;
[SetUp]
public void SetUp ()
{
_tempDirectory = Path.Combine (Path.GetTempPath (), "MonoTests.System.Net.FileWebRequestTest");
_tempFile = Path.Combine (_tempDirectory, "FileWebRequestTest.tmp");
if (!Directory.Exists (_tempDirectory)) {
Directory.CreateDirectory (_tempDirectory);
} else {
// ensure no files are left over from previous runs
string [] files = Directory.GetFiles (_tempDirectory, "*");
foreach (string file in files)
File.Delete (file);
}
_tempDirectory = new TempDirectory ();
_tempFile = Path.Combine (_tempDirectory.Path, "FileWebRequestTest.tmp");
_tempFileUri = GetTempFileUri ();
}
[TearDown]
public void TearDown ()
{
if (Directory.Exists (_tempDirectory))
Directory.Delete (_tempDirectory, true);
_tempDirectory.Dispose ();
}
[Test]
@ -198,7 +190,7 @@ namespace MonoTests.System.Net
}
// the temp file should not be in use
Directory.Delete (_tempDirectory, true);
_tempDirectory.Dispose ();
}
[Test]
@ -305,7 +297,7 @@ namespace MonoTests.System.Net
}
// the temp file should not be in use
Directory.Delete (_tempDirectory, true);
_tempDirectory.Dispose ();
}
[Test]