1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -04:00

Fixed: Trim whitespace on Remote Mapping Add

Fixes #4481
This commit is contained in:
Qstick
2020-06-03 21:38:46 -04:00
parent 9ca291ecaf
commit 13f3d0292c
2 changed files with 23 additions and 4 deletions
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using FizzWare.NBuilder;
using FluentAssertions;
@@ -135,5 +135,24 @@ namespace NzbDrone.Core.Test.RemotePathMappingsTests
result.RemotePath.Should().Be(cleanedPath);
}
[TestCase(@" \\server\share\with\whitespace\ ", @"\\server\share\with\whitespace\")]
[TestCase(@" D:\with\whitespace\", @"D:\with\whitespace\")]
[TestCase(@"D:\with\whitespace\ ", @"D:\with\whitespace\")]
public void should_trim_whitespace_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);
}
}
}