Update src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs

Co-authored-by: Mark McDowall <mark@mcdowall.ca>
This commit is contained in:
Touchstone64 2025-12-04 10:00:15 +00:00 committed by GitHub
parent 854d8b3b67
commit ad104a49e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -586,17 +586,12 @@ 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 from = rootDir + Path.DirectorySeparatorChar + Path.DirectorySeparatorChar + "source-file";
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);
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);
ExceptionVerification.ExpectedWarns(1);