From: Marcos Henrich Date: Wed, 16 Mar 2016 10:04:40 +0000 (+0000) Subject: [corlib] Test FileInfo.ToString after MoveTo X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=bd79fac6894e201567300701d0694103821aad92;p=mono.git [corlib] Test FileInfo.ToString after MoveTo Covers #38796 --- diff --git a/mcs/class/corlib/Test/System.IO/FileInfoTest.cs b/mcs/class/corlib/Test/System.IO/FileInfoTest.cs index 0068c4643b8..db33ec75f0f 100644 --- a/mcs/class/corlib/Test/System.IO/FileInfoTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileInfoTest.cs @@ -880,6 +880,29 @@ namespace MonoTests.System.IO } } + [Test] //Covers #38796 + public void ToStringAfterMoveTo () + { + string name1 = "FIT.ToStringAfterMoveTo.Test"; + string name2 = "FIT.ToStringAfterMoveTo.Test.Alt"; + string path1 = TempFolder + DSC + name1; + string path2 = TempFolder + DSC + name2; + DeleteFile (path1); + DeleteFile (path2); + + try { + File.Create (path1).Close (); + FileInfo info = new FileInfo (path1); + Assert.AreEqual (path1, info.ToString (), "#A"); + + info.MoveTo (path2); + Assert.AreEqual (path2, info.ToString (), "#B"); + } finally { + DeleteFile (path1); + DeleteFile (path2); + } + } + #if !MOBILE [Test] public void Replace1 ()