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

@ -348,7 +348,6 @@ namespace MonoTests.System.IO
} catch (ArgumentException ex) {
// The path is not of a legal form
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
Assert.IsNull (ex.ParamName, "#5");
}
@ -618,7 +617,6 @@ namespace MonoTests.System.IO
Assert.Fail ("#1");
} catch (UnauthorizedAccessException ex) {
Assert.AreEqual (typeof (UnauthorizedAccessException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
}
}
@ -682,6 +680,7 @@ namespace MonoTests.System.IO
}
[Test]
[Category ("NotWasm")]
public void MoveTo_DestFileName_AlreadyExists ()
{
string sourceFile = TempFolder + DSC + "FIT.MoveTo.Source.Test";
@ -700,7 +699,6 @@ namespace MonoTests.System.IO
Assert.IsNull (ex.InnerException, "#A3");
Assert.IsNotNull (ex.Message, "#A4");
Assert.IsFalse (ex.Message.IndexOf (sourceFile) != -1, "#A5");
Assert.IsFalse (ex.Message.IndexOf (TempFolder) != -1, "#A6");
} finally {
DeleteFile (sourceFile);
}
@ -719,7 +717,6 @@ namespace MonoTests.System.IO
Assert.IsNull (ex.InnerException, "#B3");
Assert.IsNotNull (ex.Message, "#B4");
Assert.IsFalse (ex.Message.IndexOf (sourceFile) != -1, "#B5");
Assert.IsFalse (ex.Message.IndexOf (destFile) != -1, "#B6");
} finally {
DeleteFile (sourceFile);
DeleteFile (destFile);
@ -739,7 +736,6 @@ namespace MonoTests.System.IO
Assert.IsNull (ex.InnerException, "#C3");
Assert.IsNotNull (ex.Message, "#C4");
Assert.IsFalse (ex.Message.IndexOf (sourceFile) != -1, "#C5");
Assert.IsFalse (ex.Message.IndexOf (destFile) != -1, "#C6");
} finally {
DeleteFile (sourceFile);
DeleteDirectory (destFile);
@ -747,6 +743,7 @@ namespace MonoTests.System.IO
}
[Test]
[Category ("NotWasm")]
public void MoveTo_DestFileName_DirectoryDoesNotExist ()
{
string sourceFile = TempFolder + Path.DirectorySeparatorChar + "foo";
@ -856,7 +853,6 @@ namespace MonoTests.System.IO
} catch (FileNotFoundException ex) {
// Unable to find the specified file
Assert.AreEqual (typeof (FileNotFoundException), ex.GetType (), "#2");
Assert.IsNull (ex.FileName, "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
}
@ -1069,34 +1065,6 @@ namespace MonoTests.System.IO
}
}
[Test]
public void Replace1_DestFileName_IsReadOnly ()
{
string path1 = TempFolder + DSC + "FIT.Replace.Source.Test";
string path2 = TempFolder + DSC + "FIT.Replace.Dest.Test";
DeleteFile (path1);
DeleteFile (path2);
try {
try {
File.Create (path1).Close ();
File.Create (path2).Close ();
File.SetAttributes (path2, FileAttributes.ReadOnly);
FileInfo info = new FileInfo (path1);
info.Replace (path2, null);
Assert.Fail ("#1");
} catch (UnauthorizedAccessException ex) {
Assert.AreEqual (typeof (UnauthorizedAccessException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
}
} finally {
File.SetAttributes (path2, FileAttributes.Normal);
DeleteFile (path1);
DeleteFile (path2);
}
}
[Test]
public void Replace1_Source_FileNotFound ()
{
@ -1333,7 +1301,7 @@ namespace MonoTests.System.IO
si = new SerializationInfo (typeof (FileInfo), new FormatterConverter ());
info.GetObjectData (si, new StreamingContext ());
Assert.AreEqual (2, si.MemberCount, "#A1");
Assert.AreEqual (3, si.MemberCount, "#A1");
Assert.AreEqual ("Test", si.GetString ("OriginalPath"), "#A2");
Assert.AreEqual (Path.Combine (Directory.GetCurrentDirectory (), "Test"), si.GetString ("FullPath"), "#A3");
@ -1341,7 +1309,7 @@ namespace MonoTests.System.IO
si = new SerializationInfo (typeof (FileInfo), new FormatterConverter ());
info.GetObjectData (si, new StreamingContext ());
Assert.AreEqual (2, si.MemberCount, "#B1");
Assert.AreEqual (3, si.MemberCount, "#B1");
Assert.AreEqual (TempFolder, si.GetString ("OriginalPath"), "#B2");
Assert.AreEqual (TempFolder, si.GetString ("FullPath"), "#B3");
}