mirror of
https://github.com/Radarr/Radarr
synced 2026-01-25 08:53:02 +01:00
Duplicate the unit test committed to the Sonarr flavour of this fix, to make maintenance easier.
This commit is contained in:
parent
711d93c312
commit
e7e3a1c2ee
1 changed files with 4 additions and 10 deletions
|
|
@ -547,17 +547,11 @@ public void TransferFile_should_find_files_with_multiple_slashes_within_their_pa
|
|||
|
||||
var root = GetFilledTempFolder();
|
||||
var rootDir = root.FullName;
|
||||
var fromFileName = "source-file";
|
||||
var from = Path.Combine(rootDir, fromFileName);
|
||||
var to = Path.Combine(rootDir, "destination-file");
|
||||
|
||||
var oneSlash = new string(Path.DirectorySeparatorChar, 1);
|
||||
var threeSlashes = new string(Path.DirectorySeparatorChar, 3);
|
||||
var overSlashed = Path.Combine(rootDir.Replace(oneSlash, threeSlashes), fromFileName);
|
||||
|
||||
var from = Path.Combine(rootDir, "source-file");
|
||||
var toRootDir = rootDir.Replace(Path.DirectorySeparatorChar.ToString(), new string(Path.DirectorySeparatorChar, 3));
|
||||
var to = Path.Combine(toRootDir, "destination-file");
|
||||
File.WriteAllText(from, "Source file");
|
||||
|
||||
var mode = Subject.TransferFile(overSlashed, to, TransferMode.Copy);
|
||||
var mode = Subject.TransferFile(from, to, TransferMode.Copy);
|
||||
mode.Should().Be(TransferMode.Copy);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue