public void BruteMoveIfAlreadyExists() { var directory = ApplicationPaths.RootDirectory; var path1 = directory + "\\foo.bar"; CreateFoo(); var fileInfo = new FileInfo(path1); Assert.IsTrue(fileInfo.BruteMove(path1)); Assert.IsTrue(File.Exists(path1)); }
public void BruteMove2() { var directory = ApplicationPaths.RootDirectory; var path1 = directory + "\\foo.bar"; var path3 = directory + "\\test"; var path2 = directory + "\\test\\test"; if (Directory.Exists(path3)) Directory.Delete(path3, true); CreateFoo(); var fileInfo = new FileInfo(path1); Assert.IsTrue(fileInfo.BruteMove(new DirectoryInfo(path2))); Assert.IsTrue(File.Exists(path2 + "\\foo.bar")); }