mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
New: Implemented Torrent Download Clients: uTorrent, Transmission and Deluge. And several public and private Torrent Indexers.
This commit is contained in:
@@ -26,6 +26,10 @@ namespace NzbDrone.Core.Test.RemotePathMappingsTests
|
||||
Mocker.GetMock<IRemotePathMappingRepository>()
|
||||
.Setup(s => s.All())
|
||||
.Returns(new List<RemotePathMapping>());
|
||||
|
||||
Mocker.GetMock<IRemotePathMappingRepository>()
|
||||
.Setup(s => s.Insert(It.IsAny<RemotePathMapping>()))
|
||||
.Returns<RemotePathMapping>(m => m);
|
||||
}
|
||||
|
||||
private void GivenMapping()
|
||||
@@ -112,5 +116,24 @@ namespace NzbDrone.Core.Test.RemotePathMappingsTests
|
||||
|
||||
result.Should().Be(expectedRemotePath);
|
||||
}
|
||||
|
||||
[TestCase(@"\\server\share\with/mixed/slashes", @"\\server\share\with\mixed\slashes\")]
|
||||
[TestCase(@"D:/with/forward/slashes", @"D:\with\forward\slashes\")]
|
||||
[TestCase(@"D:/with/mixed\slashes", @"D:\with\mixed\slashes\")]
|
||||
public void should_fix_wrong_slashes_on_add(String remotePath, String cleanedPath)
|
||||
{
|
||||
GivenMapping();
|
||||
|
||||
var mapping = new RemotePathMapping
|
||||
{
|
||||
Host = "my-server.localdomain",
|
||||
RemotePath = remotePath,
|
||||
LocalPath = @"D:\mountedstorage\downloads\tv" .AsOsAgnostic()
|
||||
};
|
||||
|
||||
var result = Subject.Add(mapping);
|
||||
|
||||
result.RemotePath.Should().Be(cleanedPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user